summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2008-06-23 15:48:01 (GMT)
committerdgp <dgp@users.sourceforge.net>2008-06-23 15:48:01 (GMT)
commit40f6f2371271e33ceba3d339ba85be1fbdc037a0 (patch)
tree0933ebba122ebbcd71f008c7aa08ec30826f28c4
parentf30deabc275ddab26044f09ba7f710650f926feb (diff)
downloadtcl-40f6f2371271e33ceba3d339ba85be1fbdc037a0.zip
tcl-40f6f2371271e33ceba3d339ba85be1fbdc037a0.tar.gz
tcl-40f6f2371271e33ceba3d339ba85be1fbdc037a0.tar.bz2
* generic/tclPathObj.c: Fixed bug in Tcl_GetTranslatedPath() when
operating on the "Special path" variant of the "path" Tcl_ObjType intrep. A full normalization was getting done, in particular, coercing relative paths to absolute, contrary to what the function of producing the "translated path" is supposed to do. [Bug 1972879].
-rw-r--r--ChangeLog8
-rw-r--r--generic/tclPathObj.c13
2 files changed, 19 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index fe76282..770174f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-06-23 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tclPathObj.c: Fixed bug in Tcl_GetTranslatedPath() when
+ operating on the "Special path" variant of the "path" Tcl_ObjType
+ intrep. A full normalization was getting done, in particular, coercing
+ relative paths to absolute, contrary to what the function of
+ producing the "translated path" is supposed to do. [Bug 1972879].
+
2008-06-19 Don Porter <dgp@users.sourceforge.net>
* changes: Update for 8.5.3 release.
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index a29e86c..94240f7 100644
--- a/generic/tclPathObj.c
+++ b/generic/tclPathObj.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclPathObj.c,v 1.66 2007/12/13 15:23:20 dgp Exp $
+ * RCS: @(#) $Id: tclPathObj.c,v 1.66.2.1 2008/06/23 15:48:02 dgp Exp $
*/
#include "tclInt.h"
@@ -1596,7 +1596,16 @@ Tcl_FSGetTranslatedPath(
srcFsPathPtr = PATHOBJ(pathPtr);
if (srcFsPathPtr->translatedPathPtr == NULL) {
if (PATHFLAGS(pathPtr) != 0) {
- retObj = Tcl_FSGetNormalizedPath(interp, pathPtr);
+ /*
+ * We lack a translated path result, but we have a directory
+ * (cwdPtr) and a tail (normPathPtr), and if we join the
+ * translated version of cwdPtr to normPathPtr, we'll get the
+ * translated result we need, and can store it for future use.
+ */
+ retObj = Tcl_FSJoinToPath(Tcl_FSGetTranslatedPath(interp,
+ srcFsPathPtr->cwdPtr), 1, &(srcFsPathPtr->normPathPtr));
+ srcFsPathPtr->translatedPathPtr = retObj;
+ Tcl_IncrRefCount(retObj);
} else {
/*
* It is a pure absolute, normalized path object. This is