diff options
author | vincentdarley <vincentdarley> | 2005-03-15 22:10:58 (GMT) |
---|---|---|
committer | vincentdarley <vincentdarley> | 2005-03-15 22:10:58 (GMT) |
commit | 06cfdf8d7716b24e5778cbeaef05d8756622d010 (patch) | |
tree | 2fe8a1bd9a312d6eba4e6df6f81d6302a446b0c2 | |
parent | 04c179bb5098db811c7e1fc19fb7c8dbb5c03d56 (diff) | |
download | tcl-06cfdf8d7716b24e5778cbeaef05d8756622d010.zip tcl-06cfdf8d7716b24e5778cbeaef05d8756622d010.tar.gz tcl-06cfdf8d7716b24e5778cbeaef05d8756622d010.tar.bz2 |
more tests and a fix to bug 1158199
-rw-r--r-- | generic/tclFileName.c | 11 | ||||
-rw-r--r-- | tests/winFCmd.test | 10 |
2 files changed, 16 insertions, 5 deletions
diff --git a/generic/tclFileName.c b/generic/tclFileName.c index 5ccd455..67d606d 100644 --- a/generic/tclFileName.c +++ b/generic/tclFileName.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclFileName.c,v 1.40.2.9 2005/03/15 18:41:32 vincentdarley Exp $ + * RCS: @(#) $Id: tclFileName.c,v 1.40.2.10 2005/03/15 22:10:58 vincentdarley Exp $ */ #include "tclInt.h" @@ -271,17 +271,20 @@ ExtractWinRoot(path, resultPtr, offset, typePtr) } } else if ((path[0] == 'p' || path[0] == 'P') && (path[1] == 'r' || path[1] == 'R') - && (path[2] == 'n' || path[2] == 'N')) { + && (path[2] == 'n' || path[2] == 'N') + && path[3] == '\0') { /* Have match for 'prn' */ abs = 3; } else if ((path[0] == 'n' || path[0] == 'N') && (path[1] == 'u' || path[1] == 'U') - && (path[2] == 'l' || path[2] == 'L')) { + && (path[2] == 'l' || path[2] == 'L') + && path[3] == '\0') { /* Have match for 'nul' */ abs = 3; } else if ((path[0] == 'a' || path[0] == 'A') && (path[1] == 'u' || path[1] == 'U') - && (path[2] == 'x' || path[2] == 'X')) { + && (path[2] == 'x' || path[2] == 'X') + && path[3] == '\0') { /* Have match for 'aux' */ abs = 3; } diff --git a/tests/winFCmd.test b/tests/winFCmd.test index 937aef3..a6221c4 100644 --- a/tests/winFCmd.test +++ b/tests/winFCmd.test @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: winFCmd.test,v 1.20.2.7 2005/03/15 18:08:24 vincentdarley Exp $ +# RCS: @(#) $Id: winFCmd.test,v 1.20.2.8 2005/03/15 22:10:58 vincentdarley Exp $ # if {[lsearch [namespace children] ::tcltest] == -1} { @@ -1040,6 +1040,14 @@ test winFCmd-18.1.5 {Windows reserved path names} -constraints win -body { file pathtype lpt4 } -result "relative" +test winFCmd-18.1.6 {Windows reserved path names} -constraints win -body { + file pathtype nul +} -result "absolute" + +test winFCmd-18.1.7 {Windows reserved path names} -constraints win -body { + file pathtype null +} -result "relative" + test winFCmd-18.2 {Windows reserved path names} -constraints win -body { file pathtype com1: } -result "absolute" |