summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-07-08 10:30:07 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-07-08 10:30:07 (GMT)
commit7332635af1609ad38fa7021022dd79996b75144c (patch)
tree4a3f633d0bc10bf4df7bbdc53677c58f99248e9b /generic
parentf84ad84e4153f7bdce3247e5f5ab7477e74db51f (diff)
parent6e64f64efb7bf46602985c83e4ec87bfdefc8289 (diff)
downloadtcl-7332635af1609ad38fa7021022dd79996b75144c.zip
tcl-7332635af1609ad38fa7021022dd79996b75144c.tar.gz
tcl-7332635af1609ad38fa7021022dd79996b75144c.tar.bz2
Merge core-8-6-branch: 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}
Diffstat (limited to 'generic')
-rw-r--r--generic/tclPathObj.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index cf8d784..68ec2c4 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) {