summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2017-04-28 17:52:26 (GMT)
committerdgp <dgp@users.sourceforge.net>2017-04-28 17:52:26 (GMT)
commit20e304e69bb30dbe0c5d9266d1841d39b6a003f2 (patch)
tree29f65248b6367f7c82c136d7e0cf4c44dd1d8ca6 /generic
parenta9e0b87ff083c31bd1a9873ee95110b352aa02bf (diff)
parenta291109ed2c14d7a263b8b8132e2688266223c97 (diff)
downloadtcl-20e304e69bb30dbe0c5d9266d1841d39b6a003f2.zip
tcl-20e304e69bb30dbe0c5d9266d1841d39b6a003f2.tar.gz
tcl-20e304e69bb30dbe0c5d9266d1841d39b6a003f2.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.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclPathObj.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index c2643bf..20f41a3 100644
--- a/generic/tclPathObj.c
+++ b/generic/tclPathObj.c
@@ -948,6 +948,7 @@ TclJoinPath(
}
}
strElt = Tcl_GetStringFromObj(elt, &strEltLen);
+ driveNameLength = 0;
type = TclGetPathType(elt, &fsPtr, &driveNameLength, &driveName);
if (type != TCL_PATH_RELATIVE) {
/*
@@ -1003,6 +1004,12 @@ TclJoinPath(
}
}
ptr = strElt;
+ /* [Bug f34cf83dd0] */
+ if (driveNameLength > 0) {
+ if (ptr[0] == '/' && ptr[-1] == '/') {
+ goto noQuickReturn;
+ }
+ }
while (*ptr != '\0') {
if (*ptr == '/' && (ptr[1] == '/' || ptr[1] == '\0')) {
/*