summaryrefslogtreecommitdiffstats
path: root/win/tclWinFile.c
diff options
context:
space:
mode:
Diffstat (limited to 'win/tclWinFile.c')
-rw-r--r--win/tclWinFile.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index 80d0915..c9b95a0 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -2897,7 +2897,7 @@ TclNativeCreateNativeRep(
char *nativePathPtr, *str;
Tcl_DString ds;
Tcl_Obj *validPathPtr;
- int len;
+ int len, i = 2;
WCHAR *wp;
if (TclFSCwdIsNative()) {
@@ -2927,8 +2927,10 @@ TclNativeCreateNativeRep(
Tcl_WinUtfToTChar(str, len, &ds);
len = Tcl_DStringLength(&ds) + sizeof(WCHAR);
wp = (WCHAR *) Tcl_DStringValue(&ds);
- for (; *wp; ++wp) {
- if (*wp=='/') {
+ for (i=sizeof(WCHAR); i<len; ++wp,i+=sizeof(WCHAR)) {
+ if ( (*wp < ' ') || wcschr(L"\"*<>|", *wp) ){
+ *wp |= 0xF000;
+ }else if (*wp=='/') {
*wp = '\\';
}
}