summaryrefslogtreecommitdiffstats
path: root/win/tclWinFile.c
diff options
context:
space:
mode:
authordgp@users.sourceforge.net <dgp>2014-11-03 20:54:12 (GMT)
committerdgp@users.sourceforge.net <dgp>2014-11-03 20:54:12 (GMT)
commit9b359450ef73d4ced9dfb3999aa2ef9ac1c554d3 (patch)
tree02a53669abb63933d41502ab5ab8be25d962b193 /win/tclWinFile.c
parentc5acb7e4cdaa6dc77b581fa029cea7c2910f8c57 (diff)
parent37cce8feb8dce8f7ea288fb42678107db79a9a0c (diff)
downloadtcl-9b359450ef73d4ced9dfb3999aa2ef9ac1c554d3.zip
tcl-9b359450ef73d4ced9dfb3999aa2ef9ac1c554d3.tar.gz
tcl-9b359450ef73d4ced9dfb3999aa2ef9ac1c554d3.tar.bz2
merge 8.5
Diffstat (limited to 'win/tclWinFile.c')
-rw-r--r--win/tclWinFile.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index 9bf63b1..7487022 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -1225,9 +1225,9 @@ WinIsReserved(
if ((path[0] == 'c' || path[0] == 'C')
&& (path[1] == 'o' || path[1] == 'O')) {
if ((path[2] == 'm' || path[2] == 'M')
- && path[3] >= '1' && path[3] <= '4') {
+ && path[3] >= '1' && path[3] <= '9') {
/*
- * May have match for 'com[1-4]:?', which is a serial port.
+ * May have match for 'com[1-9]:?', which is a serial port.
*/
if (path[4] == '\0') {
@@ -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.