diff options
author | ashok <ashok> | 2016-07-08 07:58:00 (GMT) |
---|---|---|
committer | ashok <ashok> | 2016-07-08 07:58:00 (GMT) |
commit | 6e64f64efb7bf46602985c83e4ec87bfdefc8289 (patch) | |
tree | 008cdac4612f0d4be996dcd4a962c49bf047fe03 /generic | |
parent | 0aa3b5113db3c6c750aa4bbcfdb657dec48c0de1 (diff) | |
download | tcl-6e64f64efb7bf46602985c83e4ec87bfdefc8289.zip tcl-6e64f64efb7bf46602985c83e4ec87bfdefc8289.tar.gz tcl-6e64f64efb7bf46602985c83e4ec87bfdefc8289.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}
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclPathObj.c | 10 |
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) { |