diff options
author | dgp <dgp@users.sourceforge.net> | 2008-06-23 15:43:41 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2008-06-23 15:43:41 (GMT) |
commit | 8d9b9cd6971af4e559b5a59c9d5c171ad929e971 (patch) | |
tree | b398311e18c9d4df1f56edb46a2c448f9f2ba7b1 /generic/tclIOUtil.c | |
parent | 1fb57b6d1676a36efbccd5fa344f4dca7c3e0a7a (diff) | |
download | tcl-8d9b9cd6971af4e559b5a59c9d5c171ad929e971.zip tcl-8d9b9cd6971af4e559b5a59c9d5c171ad929e971.tar.gz tcl-8d9b9cd6971af4e559b5a59c9d5c171ad929e971.tar.bz2 |
* generic/tclIOUtil.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].
Diffstat (limited to 'generic/tclIOUtil.c')
-rw-r--r-- | generic/tclIOUtil.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index aae1e84..19a7729 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -17,7 +17,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIOUtil.c,v 1.77.2.35 2007/12/14 02:29:21 hobbs Exp $ + * RCS: @(#) $Id: tclIOUtil.c,v 1.77.2.36 2008/06/23 15:43:42 dgp Exp $ */ #include "tclInt.h" @@ -5434,7 +5434,16 @@ Tcl_FSGetTranslatedPath(interp, pathPtr) srcFsPathPtr = (FsPath*) 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. |