summaryrefslogtreecommitdiffstats
path: root/win/tclWinFile.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2014-04-10 13:32:14 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2014-04-10 13:32:14 (GMT)
commitc5510a29171fa3a62f7a51af11bea2772bf10e3e (patch)
treefda90135c6bce6cf48e9cf64d7fd64ceab6ed504 /win/tclWinFile.c
parent7e0a9605b9a1e3bc52ff27cdbc7311608f4cce18 (diff)
downloadtcl-c5510a29171fa3a62f7a51af11bea2772bf10e3e.zip
tcl-c5510a29171fa3a62f7a51af11bea2772bf10e3e.tar.gz
tcl-c5510a29171fa3a62f7a51af11bea2772bf10e3e.tar.bz2
[792641f95b]: Normalized win32 paths should never contain backslash.
Diffstat (limited to 'win/tclWinFile.c')
-rw-r--r--win/tclWinFile.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index 676c443..ed0c40f 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -3197,17 +3197,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);
if (tclWinProcs->useWide) {
+ WCHAR *wp = (WCHAR *) Tcl_DStringValue(&ds);
+ for (; *wp; ++wp) {
+ if (*wp=='/') {
+ *wp = '\\';
+ }
+ }
len = Tcl_DStringLength(&ds) + sizeof(WCHAR);
} else {
len = Tcl_DStringLength(&ds) + sizeof(char);