summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2004-03-09 12:57:25 (GMT)
committervincentdarley <vincentdarley>2004-03-09 12:57:25 (GMT)
commit2e488121f5c9875f01b112b8050af3dedb46ec8b (patch)
tree9a3f54133af8c714334717435b8ce80f3cb1dee7
parent2dd8bab9ea68a16f698de9db76e32964bb7e6c06 (diff)
downloadtcl-2e488121f5c9875f01b112b8050af3dedb46ec8b.zip
tcl-2e488121f5c9875f01b112b8050af3dedb46ec8b.tar.gz
tcl-2e488121f5c9875f01b112b8050af3dedb46ec8b.tar.bz2
glob -path fix for near filesystem root
-rw-r--r--generic/tclFileName.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/generic/tclFileName.c b/generic/tclFileName.c
index e4c9fd8..1ca1d03 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.48 2004/03/09 12:54:02 vincentdarley Exp $
+ * RCS: @(#) $Id: tclFileName.c,v 1.49 2004/03/09 12:57:25 vincentdarley Exp $
*/
#include "tclInt.h"
@@ -1746,8 +1746,11 @@ Tcl_GlobObjCmd(dummy, interp, objc, objv)
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:/".
+ * We must ensure that we haven't cut off too much,
+ * and turned a valid path like '/' or 'C:/' into
+ * an incorrect path like '' or 'C:'. The way we
+ * do this is to add a separator if there are none
+ * presently in the prefix.
*/
if (strpbrk(Tcl_GetString(pathOrDir), "\\/") == NULL) {
Tcl_AppendToObj(pathOrDir, last-1, 1);