summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--win/tclWinFCmd.c5
-rw-r--r--win/tclWinFile.c16
2 files changed, 12 insertions, 9 deletions
diff --git a/win/tclWinFCmd.c b/win/tclWinFCmd.c
index f14d9ff..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;
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index f69ad23..80d0915 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -2898,6 +2898,7 @@ TclNativeCreateNativeRep(
Tcl_DString ds;
Tcl_Obj *validPathPtr;
int len;
+ WCHAR *wp;
if (TclFSCwdIsNative()) {
/*
@@ -2923,17 +2924,14 @@ TclNativeCreateNativeRep(
}
str = Tcl_GetStringFromObj(validPathPtr, &len);
- if (str[0] == '/' && str[1] == '/' && str[2] == '?' && str[3] == '/') {
- char *p;
-
- for (p = str; p && *p; ++p) {
- if (*p == '/') {
- *p = '\\';
- }
- }
- }
Tcl_WinUtfToTChar(str, len, &ds);
len = Tcl_DStringLength(&ds) + sizeof(WCHAR);
+ wp = (WCHAR *) Tcl_DStringValue(&ds);
+ for (; *wp; ++wp) {
+ if (*wp=='/') {
+ *wp = '\\';
+ }
+ }
Tcl_DecrRefCount(validPathPtr);
nativePathPtr = ckalloc(len);
memcpy(nativePathPtr, Tcl_DStringValue(&ds), (size_t) len);