summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2017-04-28 17:49:43 (GMT)
committerdgp <dgp@users.sourceforge.net>2017-04-28 17:49:43 (GMT)
commit64f999ee893448c079cadda5b07e13a51066dad0 (patch)
treeea96270f5265d41d2e17a1bb7d8c059d681095fe
parent79426acd5509c22fe6948d2668a349775b72067e (diff)
downloadtcl-64f999ee893448c079cadda5b07e13a51066dad0.zip
tcl-64f999ee893448c079cadda5b07e13a51066dad0.tar.gz
tcl-64f999ee893448c079cadda5b07e13a51066dad0.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 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')) {
/*