diff options
author | vincentdarley <vincentdarley> | 2004-10-07 14:50:21 (GMT) |
---|---|---|
committer | vincentdarley <vincentdarley> | 2004-10-07 14:50:21 (GMT) |
commit | d4961998794e12b24a57463f33d6d1976477cde3 (patch) | |
tree | 56b0a5bc0092ddc26c1ff14e61906c9ea713c988 /generic/tclFileName.c | |
parent | 4c14cd729fc9965bddaace767c865ce4a9825e89 (diff) | |
download | tcl-d4961998794e12b24a57463f33d6d1976477cde3.zip tcl-d4961998794e12b24a57463f33d6d1976477cde3.tar.gz tcl-d4961998794e12b24a57463f33d6d1976477cde3.tar.bz2 |
filesystem generic/platform code splitting
Diffstat (limited to 'generic/tclFileName.c')
-rw-r--r-- | generic/tclFileName.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/generic/tclFileName.c b/generic/tclFileName.c index 785769a..aba17d7 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.59 2004/10/06 23:44:06 dkf Exp $ + * RCS: @(#) $Id: tclFileName.c,v 1.60 2004/10/07 14:50:21 vincentdarley Exp $ */ #include "tclInt.h" @@ -1788,8 +1788,19 @@ TclGlob(interp, pattern, pathPrefix, globFlags, types) /* If this length has never been set, set it here */ CONST char *pre = Tcl_GetStringFromObj(pathPrefix, &prefixLen); - if (prefixLen > 0) { - if (strchr(separators, pre[prefixLen-1]) == NULL) { + if (prefixLen > 0 + && (strchr(separators, pre[prefixLen-1]) == NULL)) { + + /* + * If we're on Windows and the prefix is a volume + * relative one like 'C:', then there won't be + * a path separator in between, so no need to + * skip it here. + */ + + if ((tclPlatform != TCL_PLATFORM_WINDOWS) + || (prefixLen != 2) + || (pre[1] != ':')) { prefixLen++; } } |