diff options
Diffstat (limited to 'generic/tclFileName.c')
-rw-r--r-- | generic/tclFileName.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/generic/tclFileName.c b/generic/tclFileName.c index 33f6f52..adbae7a 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.53 2004/04/06 22:25:51 dgp Exp $ + * RCS: @(#) $Id: tclFileName.c,v 1.54 2004/05/07 07:44:37 vincentdarley Exp $ */ #include "tclInt.h" @@ -1695,6 +1695,20 @@ TclGlob(interp, pattern, pathPrefix, globFlags, types) } } + /* + * Finally if we still haven't managed to generate a path + * prefix, check if the path starts with a current volume. + */ + if (pathPrefix == NULL) { + int driveNameLen; + Tcl_Obj *driveName; + if (TclFSNonnativePathType(tail, strlen(tail), NULL, &driveNameLen, + &driveName) == TCL_PATH_ABSOLUTE) { + pathPrefix = driveName; + tail += driveNameLen; + } + } + /* * We need to get the old result, in case it is over-written * below when we still need it. @@ -1852,7 +1866,10 @@ SkipToChar(stringPtr, match) * path name to be globbed and the pattern. The directory and * remainder are assumed to be native format paths. The prefix * contained in 'pathPtr' is either a directory or path from which - * to start the search (or NULL). + * to start the search (or NULL). If pathPtr is NULL, then the + * pattern must not start with an absolute path specification + * (that case should be handled by moving the absolute path + * prefix into pathPtr before calling DoGlob). * * Results: * The return value is a standard Tcl result indicating whether |