summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2005-03-15 18:07:51 (GMT)
committervincentdarley <vincentdarley>2005-03-15 18:07:51 (GMT)
commit05d93eeba37091d79b51b79a75fd4c0b273b0738 (patch)
treeebd3a61d6d133f269141b77e19702a8b680806cb /generic
parent1d8584189dc0a9e3af8e170fbcac1fe2772b64e9 (diff)
downloadtcl-05d93eeba37091d79b51b79a75fd4c0b273b0738.zip
tcl-05d93eeba37091d79b51b79a75fd4c0b273b0738.tar.gz
tcl-05d93eeba37091d79b51b79a75fd4c0b273b0738.tar.bz2
fix to file norm, file pathtype on windows reserved filenames
Diffstat (limited to 'generic')
-rw-r--r--generic/tclFileName.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/generic/tclFileName.c b/generic/tclFileName.c
index 5b4430c..7aac689 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.63 2005/02/10 17:09:49 vincentdarley Exp $
+ * RCS: @(#) $Id: tclFileName.c,v 1.64 2005/03/15 18:07:56 vincentdarley Exp $
*/
#include "tclInt.h"
@@ -160,37 +160,38 @@ ExtractWinRoot(path, resultPtr, offset, typePtr)
}
} else {
int abs = 0;
- if (path[0] == 'c' && path[1] == 'o') {
- if (path[2] == 'm' && path[3] >= '1' && path[3] <= '9') {
- /* May have match for 'com[1-9]:?', which is a serial port */
+ 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') {
+ /* May have match for 'com[1-4]:?', which is a serial port */
if (path[4] == '\0') {
abs = 4;
} else if (path [4] == ':' && path[5] == '\0') {
abs = 5;
}
- } else if (path[2] == 'n' && path[3] == '\0') {
+ } else if ((path[2] == 'n' || path[2] == 'N') && path[3] == '\0') {
/* Have match for 'con' */
abs = 3;
}
- } else if (path[0] == 'l' && path[1] == 'p' && path[2] == 't') {
- if (path[3] >= '1' && path[3] <= '9') {
- /* May have match for 'lpt[1-9]:?' */
+ } else if ((path[0] == 'l' || path[0] == 'L')
+ && (path[1] == 'p' || path[1] == 'P')
+ && (path[2] == 't' || path[2] == 'T')) {
+ if (path[3] >= '1' && path[3] <= '3') {
+ /* May have match for 'lpt[1-3]:?' */
if (path[4] == '\0') {
abs = 4;
} else if (path [4] == ':' && path[5] == '\0') {
abs = 5;
}
}
- } else if (path[0] == 'p' && path[1] == 'r'
- && path[2] == 'n' && path[3] == '\0') {
+ } else if (stricmp(path, "prn") == 0) {
/* Have match for 'prn' */
abs = 3;
- } else if (path[0] == 'n' && path[1] == 'u'
- && path[2] == 'l' && path[3] == '\0') {
+ } else if (stricmp(path, "nul") == 0) {
/* Have match for 'nul' */
abs = 3;
- } else if (path[0] == 'a' && path[1] == 'u'
- && path[2] == 'x' && path[3] == '\0') {
+ } else if (stricmp(path, "aux") == 0) {
/* Have match for 'aux' */
abs = 3;
}