summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authoraspect <aspect+tclcore@abstracted-spleen.org>2017-04-29 11:04:10 (GMT)
committeraspect <aspect+tclcore@abstracted-spleen.org>2017-04-29 11:04:10 (GMT)
commit83852c4bca6320aa6c14b148b137430aec4c5260 (patch)
treeba4b36e067db9d738e5ad918327137c0de090c20 /generic
parent52482ea1e528751dcb61e736532dcc86469ccbc3 (diff)
downloadtcl-83852c4bca6320aa6c14b148b137430aec4c5260.zip
tcl-83852c4bca6320aa6c14b148b137430aec4c5260.tar.gz
tcl-83852c4bca6320aa6c14b148b137430aec4c5260.tar.bz2
[f9fe90d0fa]: more path normalization in TclNewFSPathObjbug_f9fe90d0fa
Diffstat (limited to 'generic')
-rw-r--r--generic/tclPathObj.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index 43a3c85..ea15937 100644
--- a/generic/tclPathObj.c
+++ b/generic/tclPathObj.c
@@ -1278,6 +1278,15 @@ TclNewFSPathObj(
const char *p;
int state = 0, count = 0;
+ /* if dirPtr is already tclFsPathType, its string representation
+ * may not be canonical. Try to use its normPathPtr in this case.
+ */
+ if ( (dirPtr->typePtr == &tclFsPathType)
+ && (PATHOBJ(dirPtr)->cwdPtr == NULL)
+ && (PATHOBJ(dirPtr)->normPathPtr != NULL) ) {
+ dirPtr = PATHOBJ(dirPtr)->normPathPtr;
+ }
+
/* [Bug 2806250] - this is only a partial solution of the problem.
* The PATHFLAGS != 0 representation assumes in many places that
* the "tail" part stored in the normPathPtr field is itself a