diff options
author | dgp <dgp@users.sourceforge.net> | 2014-04-16 17:35:08 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2014-04-16 17:35:08 (GMT) |
commit | 477c964bdc908522a6a802e40b7526f8fe812a73 (patch) | |
tree | dc4a20a2300207f7ea5c269b2526820296e14da9 /win/tclWinFCmd.c | |
parent | 870ed20799fc0d228ffcf6e7add98824b0182950 (diff) | |
parent | c37220bed3a6c2c42a369ca18cf216568a86b1c1 (diff) | |
download | tcl-477c964bdc908522a6a802e40b7526f8fe812a73.zip tcl-477c964bdc908522a6a802e40b7526f8fe812a73.tar.gz tcl-477c964bdc908522a6a802e40b7526f8fe812a73.tar.bz2 |
merge trunk
Diffstat (limited to 'win/tclWinFCmd.c')
-rw-r--r-- | win/tclWinFCmd.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/win/tclWinFCmd.c b/win/tclWinFCmd.c index 2700cb3..52ea8c6 100644 --- a/win/tclWinFCmd.c +++ b/win/tclWinFCmd.c @@ -1108,7 +1108,12 @@ DoRemoveJustDirectory( end: if (errorPtr != NULL) { + char *p; Tcl_WinTCharToUtf(nativePath, -1, errorPtr); + p = Tcl_DStringValue(errorPtr); + for (; *p; ++p) { + if (*p == '\\') *p = '/'; + } } return TCL_ERROR; @@ -1825,12 +1830,12 @@ SetWinFileAttributes( Tcl_Obj *fileName, /* The name of the file. */ Tcl_Obj *attributePtr) /* The new value of the attribute. */ { - DWORD fileAttributes; + DWORD fileAttributes, old; int yesNo, result; const TCHAR *nativeName; nativeName = Tcl_FSGetNativePath(fileName); - fileAttributes = GetFileAttributes(nativeName); + fileAttributes = old = GetFileAttributes(nativeName); if (fileAttributes == 0xffffffff) { StatError(interp, fileName); @@ -1848,7 +1853,8 @@ SetWinFileAttributes( fileAttributes &= ~(attributeArray[objIndex]); } - if (!SetFileAttributes(nativeName, fileAttributes)) { + if ((fileAttributes != old) + && !SetFileAttributes(nativeName, fileAttributes)) { StatError(interp, fileName); return TCL_ERROR; } |