summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvasiljevic <zv@archiware.com>2003-12-17 09:25:26 (GMT)
committervasiljevic <zv@archiware.com>2003-12-17 09:25:26 (GMT)
commit52ce50363a15ac6a302c54631914a6e2c19af001 (patch)
treefcd5c2e91601ba0455e1a3434963bf8950e7771a
parentb3de138399380858c1de691bee46c40a5b5a3d1a (diff)
downloadtcl-52ce50363a15ac6a302c54631914a6e2c19af001.zip
tcl-52ce50363a15ac6a302c54631914a6e2c19af001.tar.gz
tcl-52ce50363a15ac6a302c54631914a6e2c19af001.tar.bz2
fixed Tcl_FSGetTranslatedPath to always return properly refcounted
path object. This fixes Tcl Bug #861515.
-rw-r--r--generic/tclPathObj.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index 1f009bd..db469bc 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.16 2003/12/14 17:38:37 dkf Exp $
+ * RCS: @(#) $Id: tclPathObj.c,v 1.17 2003/12/17 09:25:26 vasiljevic Exp $
*/
#include "tclInt.h"
@@ -1086,15 +1086,16 @@ Tcl_FSGetTranslatedPath(interp, pathPtr)
srcFsPathPtr = (FsPath*) PATHOBJ(pathPtr);
if (srcFsPathPtr->translatedPathPtr == NULL) {
if (PATHFLAGS(pathPtr) != 0) {
- return Tcl_FSGetNormalizedPath(interp, pathPtr);
+ retObj = Tcl_FSGetNormalizedPath(interp, pathPtr);
+ } else {
+ /*
+ * It is a pure absolute, normalized path object.
+ * This is something like being a 'pure list'. The
+ * object's string, translatedPath and normalizedPath
+ * are all identical.
+ */
+ retObj = srcFsPathPtr->normPathPtr;
}
- /*
- * It is a pure absolute, normalized path object.
- * This is something like being a 'pure list'. The
- * object's string, translatedPath and normalizedPath
- * are all identical.
- */
- retObj = srcFsPathPtr->normPathPtr;
} else {
/* It is an ordinary path object */
retObj = srcFsPathPtr->translatedPathPtr;