summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorashok <ashok>2016-07-08 07:58:00 (GMT)
committerashok <ashok>2016-07-08 07:58:00 (GMT)
commit47620e4ba8a3fc6f4efee83655e01de74cca33b2 (patch)
tree008cdac4612f0d4be996dcd4a962c49bf047fe03
parent85d1666247031e3e951f4817797a6c3d205ed388 (diff)
downloadtcl-47620e4ba8a3fc6f4efee83655e01de74cca33b2.zip
tcl-47620e4ba8a3fc6f4efee83655e01de74cca33b2.tar.gz
tcl-47620e4ba8a3fc6f4efee83655e01de74cca33b2.tar.bz2
Bug [a47641a031]. TclJoinPath was calling TclNewFSPathObj with a
first argument that was not an absolute path. Added a check for that. Fixes Windows test failures fileSystem-1.{3,4}
-rw-r--r--generic/tclPathObj.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index 99d576d..c2643bf 100644
--- a/generic/tclPathObj.c
+++ b/generic/tclPathObj.c
@@ -869,12 +869,16 @@ TclJoinPath(
* object which can be normalized more efficiently. Currently we only
* use the special case when we have exactly two elements, but we
* could expand that in the future.
+ *
+ * Bugfix [a47641a0]. TclNewFSPathObj requires first argument
+ * to be an absolute path. Added a check for that elt is absolute.
*/
if ((i == (elements-2)) && (i == 0)
- && (elt->typePtr == &tclFsPathType)
- && !((elt->bytes != NULL) && (elt->bytes[0] == '\0'))) {
- Tcl_Obj *tailObj = objv[i+1];
+ && (elt->typePtr == &tclFsPathType)
+ && !((elt->bytes != NULL) && (elt->bytes[0] == '\0'))
+ && TclGetPathType(elt, NULL, NULL, NULL) == TCL_PATH_ABSOLUTE) {
+ Tcl_Obj *tailObj = objv[i+1];
type = TclGetPathType(tailObj, NULL, NULL, NULL);
if (type == TCL_PATH_RELATIVE) {