From 2e488121f5c9875f01b112b8050af3dedb46ec8b Mon Sep 17 00:00:00 2001 From: vincentdarley Date: Tue, 9 Mar 2004 12:57:25 +0000 Subject: glob -path fix for near filesystem root --- generic/tclFileName.c | 9 ++++++--- 1 file 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); -- cgit v0.12