diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2014-10-31 09:59:36 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2014-10-31 09:59:36 (GMT) |
commit | f6161cafab22785e5a346b26bd0ef59cdb950c57 (patch) | |
tree | 99965f2ae63150e2f2827340e4c3e6d975e27609 /win/tclWinFile.c | |
parent | aa669c0d1cbe8d3fd7e7ce23cca9a9bfa3807631 (diff) | |
download | tcl-f6161cafab22785e5a346b26bd0ef59cdb950c57.zip tcl-f6161cafab22785e5a346b26bd0ef59cdb950c57.tar.gz tcl-f6161cafab22785e5a346b26bd0ef59cdb950c57.tar.bz2 |
When translating a reserved devicename to native pathname, strip ':' postfix. Possible fix for [dcc03414f5], but anyway a good idea.
Diffstat (limited to 'win/tclWinFile.c')
-rw-r--r-- | win/tclWinFile.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 9bf63b1..163050e 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -3203,7 +3203,10 @@ TclNativeCreateNativeRep( Tcl_WinUtfToTChar(str, len, &ds); if (tclWinProcs->useWide) { WCHAR *wp = (WCHAR *) Tcl_DStringValue(&ds); - len = Tcl_DStringLength(&ds)>>1; + /* For a reserved device, strip a possible postfix ':' */ + len = WinIsReserved(str); + /* For normal devices */ + if (len == 0) len = Tcl_DStringLength(&ds)>>1; /* ** If path starts with "//?/" or "\\?\" (extended path), translate ** any slashes to backslashes but accept the '?' as being valid. |