summaryrefslogtreecommitdiffstats
path: root/generic/tclPathObj.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2017-04-28 17:57:34 (GMT)
committerdgp <dgp@users.sourceforge.net>2017-04-28 17:57:34 (GMT)
commit52482ea1e528751dcb61e736532dcc86469ccbc3 (patch)
treed384895fd46934c431cf1c76cb703dcd57eb0c59 /generic/tclPathObj.c
parent7ead67a5cb3303633020b1c5c66e259c97904b26 (diff)
parent20e304e69bb30dbe0c5d9266d1841d39b6a003f2 (diff)
downloadtcl-52482ea1e528751dcb61e736532dcc86469ccbc3.zip
tcl-52482ea1e528751dcb61e736532dcc86469ccbc3.tar.gz
tcl-52482ea1e528751dcb61e736532dcc86469ccbc3.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/tclPathObj.c')
-rw-r--r--generic/tclPathObj.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index 0053041..43a3c85 100644
--- a/generic/tclPathObj.c
+++ b/generic/tclPathObj.c
@@ -948,6 +948,7 @@ TclJoinPath(
}
}
strElt = TclGetStringFromObj(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')) {
/*