summaryrefslogtreecommitdiffstats
path: root/generic/tclIOUtil.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclIOUtil.c')
-rw-r--r--generic/tclIOUtil.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index e32578d..43be6fb 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -17,7 +17,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclIOUtil.c,v 1.145.2.2 2007/11/12 19:18:17 dgp Exp $
+ * RCS: @(#) $Id: tclIOUtil.c,v 1.145.2.3 2008/01/23 16:42:19 dgp Exp $
*/
#include "tclInt.h"
@@ -1236,10 +1236,8 @@ FsAddMountsToGlobResult(
}
}
if (!found && dir) {
- int len, mlen;
- const char *path;
- const char *mount;
Tcl_Obj *norm;
+ int len, mlen;
/*
* We know mElt is absolute normalized and lies inside pathPtr, so
@@ -1247,9 +1245,11 @@ FsAddMountsToGlobResult(
* i.e. the representation which is relative to pathPtr.
*/
- mount = Tcl_GetStringFromObj(mElt, &mlen);
norm = Tcl_FSGetNormalizedPath(NULL, pathPtr);
if (norm != NULL) {
+ const char *path, *mount;
+
+ mount = Tcl_GetStringFromObj(mElt, &mlen);
path = Tcl_GetStringFromObj(norm, &len);
if (path[len-1] == '/') {
/*
@@ -1258,7 +1258,8 @@ FsAddMountsToGlobResult(
len--;
}
- mElt = TclNewFSPathObj(pathPtr, mount + len + 1, mlen - len);
+ len++; /* account for '/' in the mElt [Bug 1602539] */
+ mElt = TclNewFSPathObj(pathPtr, mount + len, mlen - len);
Tcl_ListObjAppendElement(NULL, resultPtr, mElt);
}
/*