diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2014-05-02 08:59:56 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2014-05-02 08:59:56 (GMT) |
commit | 1e3394cc4fee92acebb7c79a7fb31aba9e1aab54 (patch) | |
tree | 84ad5e5324401e5fb231e9656e4bcecbb3387ae7 /win/tclWinFCmd.c | |
parent | 340a361ed19847861c47b986eb8d522c1a6cc700 (diff) | |
parent | 7ea92b545f09208376e9a9f8aa1aac53148f3f65 (diff) | |
download | tcl-1e3394cc4fee92acebb7c79a7fb31aba9e1aab54.zip tcl-1e3394cc4fee92acebb7c79a7fb31aba9e1aab54.tar.gz tcl-1e3394cc4fee92acebb7c79a7fb31aba9e1aab54.tar.bz2 |
merge novemnovem_bug_3598300
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 042fe67..e91f529 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; } |