summaryrefslogtreecommitdiffstats
path: root/generic/tclFileName.c
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2005-02-10 17:09:42 (GMT)
committervincentdarley <vincentdarley>2005-02-10 17:09:42 (GMT)
commit1a5a2eb1b627378e66065f252594ff677891fccc (patch)
tree983cad20c6817f0328d20c68cb2df09328690326 /generic/tclFileName.c
parentba424f61a038d5f1a7ed8a84ed461f4d5cf67283 (diff)
downloadtcl-1a5a2eb1b627378e66065f252594ff677891fccc.zip
tcl-1a5a2eb1b627378e66065f252594ff677891fccc.tar.gz
tcl-1a5a2eb1b627378e66065f252594ff677891fccc.tar.bz2
fix to test suite failures
Diffstat (limited to 'generic/tclFileName.c')
-rw-r--r--generic/tclFileName.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/generic/tclFileName.c b/generic/tclFileName.c
index cf487a5..5b4430c 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.62 2005/01/21 17:42:14 andreas_kupries Exp $
+ * RCS: @(#) $Id: tclFileName.c,v 1.63 2005/02/10 17:09:49 vincentdarley Exp $
*/
#include "tclInt.h"
@@ -2288,11 +2288,20 @@ DoGlob(interp, matchesObj, separators, pathPtr, flags, pattern, types)
} else {
joinedPtr = Tcl_DuplicateObj(pathPtr);
if (strchr(separators, pattern[0]) == NULL) {
- /* The current prefix must end in a separator */
+ /*
+ * The current prefix must end in a separator, unless
+ * this is a volume-relative path. In particular
+ * globbing in Windows shares, when not using -dir
+ * or -path, e.g. 'glob //machine/share/subdir/*'
+ * requires adding a separator here. This behaviour
+ * is not currently tested for in the test suite.
+ */
int len;
CONST char *joined = Tcl_GetStringFromObj(joinedPtr,&len);
if (strchr(separators, joined[len-1]) == NULL) {
- Tcl_AppendToObj(joinedPtr, "/", 1);
+ if (Tcl_FSGetPathType(pathPtr) != TCL_PATH_VOLUME_RELATIVE) {
+ Tcl_AppendToObj(joinedPtr, "/", 1);
+ }
}
}
Tcl_AppendToObj(joinedPtr, pattern, p-pattern);