summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--generic/tclIOUtil.c21
2 files changed, 26 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index bb80485..e055bac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-04-01 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tclIOUtil.c: Fix to privately reported vfs bug with
+ 'glob -type d -dir . *' across a vfs boundary. No tests for
+ this are currently possible without effectively moving tclvfs
+ into Tcl's test suite.
+
2004-03-31 Don Porter <dgp@users.sourceforge.net>
* doc/msgcat.n: Clarified message catalog file encodings. [Bug 811457]
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index 52bec32..e82efa5 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.97 2004/03/30 15:35:46 vincentdarley Exp $
+ * RCS: @(#) $Id: tclIOUtil.c,v 1.98 2004/04/01 11:13:01 vincentdarley Exp $
*/
#include "tclInt.h"
@@ -1161,13 +1161,30 @@ FsAddMountsToGlobResult(result, pathPtr, pattern, types)
}
}
if (!found && dir) {
+ int len, mlen;
+ CONST char *path;
+ CONST char *mount;
if (Tcl_IsShared(result)) {
Tcl_Obj *newList;
newList = Tcl_DuplicateObj(result);
Tcl_DecrRefCount(result);
result = newList;
}
- Tcl_ListObjAppendElement(NULL, result, mElt);
+ /*
+ * We know mElt is absolute normalized and lies inside pathPtr,
+ * so now we must add to the result the right
+ * representation of mElt, i.e. the representation which
+ * is relative to pathPtr.
+ */
+ mount = Tcl_GetStringFromObj(mElt, &mlen);
+ path = Tcl_GetStringFromObj(Tcl_FSGetNormalizedPath(NULL, pathPtr),
+ &len);
+ if (path[len-1] == '/') {
+ /* Deal with the root of the volume */
+ len--;
+ }
+ mElt = TclNewFSPathObj(pathPtr, mount + len + 1, mlen - len);
+ Tcl_ListObjAppendElement(NULL, result, mElt);
/*
* No need to increment gLength, since we
* don't want to compare mounts against