summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorhobbs <hobbs>2007-12-14 23:36:07 (GMT)
committerhobbs <hobbs>2007-12-14 23:36:07 (GMT)
commit30ac6357580feb97c6b19c49d1aa724e32a3faf8 (patch)
tree99028a8cd01d4391947c2b8ff6d882a9ab36af68 /generic
parent5f041541aa88639810f9d3e00a017ab5429bd0cc (diff)
downloadtcl-30ac6357580feb97c6b19c49d1aa724e32a3faf8.zip
tcl-30ac6357580feb97c6b19c49d1aa724e32a3faf8.tar.gz
tcl-30ac6357580feb97c6b19c49d1aa724e32a3faf8.tar.bz2
* generic/tclIOUtil.c (FsAddMountsToGlobResult): fix the tail
conversion of vfs mounts. [Bug 1602539]
Diffstat (limited to 'generic')
-rw-r--r--generic/tclIOUtil.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index 14d51a1..50645fa 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.148 2007/12/13 15:23:18 dgp Exp $
+ * RCS: @(#) $Id: tclIOUtil.c,v 1.149 2007/12/14 23:36:09 hobbs 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);
}
/*