diff options
author | vincentdarley <vincentdarley> | 2004-03-09 12:54:01 (GMT) |
---|---|---|
committer | vincentdarley <vincentdarley> | 2004-03-09 12:54:01 (GMT) |
commit | 2dd8bab9ea68a16f698de9db76e32964bb7e6c06 (patch) | |
tree | 9301bfd886b44be0d2c50fdf370ef9ff259b9c48 /generic/tclFileName.c | |
parent | 9c04301ef6c66c0166de0a8d94972ac3deacded6 (diff) | |
download | tcl-2dd8bab9ea68a16f698de9db76e32964bb7e6c06.zip tcl-2dd8bab9ea68a16f698de9db76e32964bb7e6c06.tar.gz tcl-2dd8bab9ea68a16f698de9db76e32964bb7e6c06.tar.bz2 |
glob -path fix for near filesystem root
Diffstat (limited to 'generic/tclFileName.c')
-rw-r--r-- | generic/tclFileName.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/generic/tclFileName.c b/generic/tclFileName.c index 0590f40..e4c9fd8 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.47 2004/02/05 20:25:32 dgp Exp $ + * RCS: @(#) $Id: tclFileName.c,v 1.48 2004/03/09 12:54:02 vincentdarley Exp $ */ #include "tclInt.h" @@ -1745,6 +1745,13 @@ Tcl_GlobObjCmd(dummy, interp, objc, objv) /* Have to split off the end */ Tcl_DStringAppend(&pref, last, first+pathlength-last); pathOrDir = Tcl_NewStringObj(first, last-first-1); + /* + * We must ensure there's at least one path separator + * in the prefix, even if it's just "/" or "C:/". + */ + if (strpbrk(Tcl_GetString(pathOrDir), "\\/") == NULL) { + Tcl_AppendToObj(pathOrDir, last-1, 1); + } } /* Need to quote 'prefix' */ Tcl_DStringInit(&prefix); |