summaryrefslogtreecommitdiffstats
path: root/generic/tclPathObj.c
diff options
context:
space:
mode:
authordgp <dgp@noemail.net>2008-06-23 04:18:32 (GMT)
committerdgp <dgp@noemail.net>2008-06-23 04:18:32 (GMT)
commit8368a108175f1acf73f455ec8d88ad8a6fef95fe (patch)
tree9b7b63168aa4e80c61630c6d1a81e45ff3779ab1 /generic/tclPathObj.c
parentf38f8003e78cff4eabe9364190f5bf6478534f48 (diff)
downloadtcl-8368a108175f1acf73f455ec8d88ad8a6fef95fe.zip
tcl-8368a108175f1acf73f455ec8d88ad8a6fef95fe.tar.gz
tcl-8368a108175f1acf73f455ec8d88ad8a6fef95fe.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]. FossilOrigin-Name: 8fbbf20d52595f44aa797fe5477c220611b32ada
Diffstat (limited to 'generic/tclPathObj.c')
-rw-r--r--generic/tclPathObj.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index 80b511e..89fb210 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.67 2008/04/27 22:21:31 dkf Exp $
+ * RCS: @(#) $Id: tclPathObj.c,v 1.68 2008/06/23 04:18:34 dgp Exp $
*/
#include "tclInt.h"
@@ -1596,7 +1596,14 @@ Tcl_FSGetTranslatedPath(
srcFsPathPtr = PATHOBJ(pathPtr);
if (srcFsPathPtr->translatedPathPtr == NULL) {
if (PATHFLAGS(pathPtr) != 0) {
- retObj = Tcl_FSGetNormalizedPath(interp, pathPtr);
+ int numBytes;
+ const char *bytes = Tcl_GetStringFromObj(pathPtr, &numBytes);
+ Tcl_Obj *copy = Tcl_NewStringObj(bytes, numBytes);
+ Tcl_IncrRefCount(copy);
+ retObj = Tcl_FSGetTranslatedPath(interp, copy);
+ srcFsPathPtr->translatedPathPtr = retObj;
+ Tcl_IncrRefCount(retObj);
+ Tcl_DecrRefCount(copy);
} else {
/*
* It is a pure absolute, normalized path object. This is