diff options
Diffstat (limited to 'generic/tclIOUtil.c')
-rw-r--r-- | generic/tclIOUtil.c | 13 |
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); } /* |