diff options
author | vincentdarley <vincentdarley> | 2005-01-17 10:40:17 (GMT) |
---|---|---|
committer | vincentdarley <vincentdarley> | 2005-01-17 10:40:17 (GMT) |
commit | 6501d3815b0a912cfff10e1b6235521f2ba756ba (patch) | |
tree | c18dacd9c667f77220e7aa531ce6a3956309dc69 | |
parent | 0f03c17746c436690647b4abe209d4bdd50c1392 (diff) | |
download | tcl-6501d3815b0a912cfff10e1b6235521f2ba756ba.zip tcl-6501d3815b0a912cfff10e1b6235521f2ba756ba.tar.gz tcl-6501d3815b0a912cfff10e1b6235521f2ba756ba.tar.bz2 |
fix to glob failure on Windows shares
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | generic/tclFileName.c | 20 |
2 files changed, 23 insertions, 2 deletions
@@ -1,3 +1,8 @@ +2005-01-17 Vince Darley <vincentdarley@users.sourceforge.net> + + * generic/tclFileName.c: fix for glob failure on Windows shares + [Bug 1100542]. + 2005-01-14 Donal K. Fellows <donal.k.fellows@man.ac.uk> * tests/compile.test (compile-17.1): Document known issue with diff --git a/generic/tclFileName.c b/generic/tclFileName.c index aba17d7..00f58d0 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.60 2004/10/07 14:50:21 vincentdarley Exp $ + * RCS: @(#) $Id: tclFileName.c,v 1.61 2005/01/17 10:40:34 vincentdarley Exp $ */ #include "tclInt.h" @@ -1933,7 +1933,7 @@ static int DoGlob(interp, matchesObj, separators, pathPtr, flags, pattern, types) Tcl_Interp *interp; /* Interpreter to use for error reporting * (e.g. unmatched brace). */ - Tcl_Obj *matchesObj; /* Unshared list object in which to place all + Tcl_Obj *matchesObj; /* Unshared list object in which to place all * resulting filenames. Caller allocates and * deallocates; DoGlob must not touch the * refCount of this object. */ @@ -2259,6 +2259,14 @@ DoGlob(interp, matchesObj, separators, pathPtr, flags, pattern, types) Tcl_DStringLength(&append)); } else { joinedPtr = Tcl_DuplicateObj(pathPtr); + if (strchr(separators, Tcl_DStringValue(&append)[0]) == NULL) { + /* The current prefix must end in a separator */ + int len; + CONST char *joined = Tcl_GetStringFromObj(joinedPtr,&len); + if (strchr(separators, joined[len-1]) == NULL) { + Tcl_AppendToObj(joinedPtr, "/", 1); + } + } Tcl_AppendToObj(joinedPtr, Tcl_DStringValue(&append), Tcl_DStringLength(&append)); } @@ -2279,6 +2287,14 @@ DoGlob(interp, matchesObj, separators, pathPtr, flags, pattern, types) joinedPtr = TclNewFSPathObj(pathPtr, pattern, p-pattern); } else { joinedPtr = Tcl_DuplicateObj(pathPtr); + if (strchr(separators, pattern[0]) == NULL) { + /* The current prefix must end in a separator */ + int len; + CONST char *joined = Tcl_GetStringFromObj(joinedPtr,&len); + if (strchr(separators, joined[len-1]) == NULL) { + Tcl_AppendToObj(joinedPtr, "/", 1); + } + } Tcl_AppendToObj(joinedPtr, pattern, p-pattern); } |