diff options
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++; } } |