summaryrefslogtreecommitdiffstats
path: root/generic/tclFileName.c
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley@noemail.net>2004-03-09 12:57:24 (GMT)
committervincentdarley <vincentdarley@noemail.net>2004-03-09 12:57:24 (GMT)
commit0acc4977f4f67aaa6f08256a16666b6ed9e944e1 (patch)
tree9a3f54133af8c714334717435b8ce80f3cb1dee7 /generic/tclFileName.c
parentf835ec6bcef85988aa5ee792a17ffec54970458d (diff)
downloadtcl-0acc4977f4f67aaa6f08256a16666b6ed9e944e1.zip
tcl-0acc4977f4f67aaa6f08256a16666b6ed9e944e1.tar.gz
tcl-0acc4977f4f67aaa6f08256a16666b6ed9e944e1.tar.bz2
glob -path fix for near filesystem root
FossilOrigin-Name: 43b58eb62313c2831b397a7b03976a045881a213
Diffstat (limited to 'generic/tclFileName.c')
-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);