summaryrefslogtreecommitdiffstats
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)
commit237c46512c0eea2cdd1a3a27f3a49009c80be60f (patch)
tree29f65248b6367f7c82c136d7e0cf4c44dd1d8ca6
parentab5586a7a3212d1176088410fa0f0c49f7821d54 (diff)
parent64f999ee893448c079cadda5b07e13a51066dad0 (diff)
downloadtcl-237c46512c0eea2cdd1a3a27f3a49009c80be60f.zip
tcl-237c46512c0eea2cdd1a3a27f3a49009c80be60f.tar.gz
tcl-237c46512c0eea2cdd1a3a27f3a49009c80be60f.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.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')) {
/*