diff options
author | dgp <dgp@users.sourceforge.net> | 2017-04-28 17:49:43 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2017-04-28 17:49:43 (GMT) |
commit | a291109ed2c14d7a263b8b8132e2688266223c97 (patch) | |
tree | ea96270f5265d41d2e17a1bb7d8c059d681095fe | |
parent | 3527da7cd3f70e14a2823aeeb014bf3e60a25231 (diff) | |
download | tcl-a291109ed2c14d7a263b8b8132e2688266223c97.zip tcl-a291109ed2c14d7a263b8b8132e2688266223c97.tar.gz tcl-a291109ed2c14d7a263b8b8132e2688266223c97.tar.bz2 |
[f34cf83dd0] An optimization was being taken in a case where it produced
the wrong result, failing to collapse multiple /// into /.
Testing on Windows where path expectations may vary would be a good idea,
but since this is just an optimization avoidance, I suspect we're ok.
-rw-r--r-- | generic/tclPathObj.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c index 95c57bf..6dd2f3f 100644 --- a/generic/tclPathObj.c +++ b/generic/tclPathObj.c @@ -948,6 +948,7 @@ Tcl_FSJoinPath( } } strElt = Tcl_GetStringFromObj(elt, &strEltLen); + driveNameLength = 0; type = TclGetPathType(elt, &fsPtr, &driveNameLength, &driveName); if (type != TCL_PATH_RELATIVE) { /* @@ -1003,6 +1004,12 @@ Tcl_FSJoinPath( } } ptr = strElt; + /* [Bug f34cf83dd0] */ + if (driveNameLength > 0) { + if (ptr[0] == '/' && ptr[-1] == '/') { + goto noQuickReturn; + } + } while (*ptr != '\0') { if (*ptr == '/' && (ptr[1] == '/' || ptr[1] == '\0')) { /* |