summaryrefslogtreecommitdiffstats
path: root/win/tclWinFCmd.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-04-16 17:35:08 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-04-16 17:35:08 (GMT)
commit477c964bdc908522a6a802e40b7526f8fe812a73 (patch)
treedc4a20a2300207f7ea5c269b2526820296e14da9 /win/tclWinFCmd.c
parent870ed20799fc0d228ffcf6e7add98824b0182950 (diff)
parentc37220bed3a6c2c42a369ca18cf216568a86b1c1 (diff)
downloadtcl-477c964bdc908522a6a802e40b7526f8fe812a73.zip
tcl-477c964bdc908522a6a802e40b7526f8fe812a73.tar.gz
tcl-477c964bdc908522a6a802e40b7526f8fe812a73.tar.bz2
merge trunk
Diffstat (limited to 'win/tclWinFCmd.c')
-rw-r--r--win/tclWinFCmd.c12
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;
}