summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixFCmd.c
diff options
context:
space:
mode:
authordas <das>2006-03-28 10:45:25 (GMT)
committerdas <das>2006-03-28 10:45:25 (GMT)
commita66b86825a5ac8be8bc3afcb1ad586d10b6c037f (patch)
treeb8acbf01530bd42bb59a6bac8e90982c4dfc4d24 /unix/tclUnixFCmd.c
parentb503a5a606a6e85a2d7b75f5649826b106f1bfd5 (diff)
downloadtcl-a66b86825a5ac8be8bc3afcb1ad586d10b6c037f.zip
tcl-a66b86825a5ac8be8bc3afcb1ad586d10b6c037f.tar.gz
tcl-a66b86825a5ac8be8bc3afcb1ad586d10b6c037f.tar.bz2
* unix/tclUnixFCmd.c (TclpObjNormalizePath): deal with *BSD/Darwin
realpath() converting relative paths into absolute paths. [Bug 1064247]
Diffstat (limited to 'unix/tclUnixFCmd.c')
-rw-r--r--unix/tclUnixFCmd.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c
index 5d9b7b6..1bba9ee 100644
--- a/unix/tclUnixFCmd.c
+++ b/unix/tclUnixFCmd.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: tclUnixFCmd.c,v 1.52 2006/03/25 01:32:11 das Exp $
+ * RCS: @(#) $Id: tclUnixFCmd.c,v 1.53 2006/03/28 10:45:25 das Exp $
*
* Portions of this code were derived from NetBSD source code which has the
* following copyright notice:
@@ -1884,9 +1884,17 @@ TclpObjNormalizePath(
nativePath = Tcl_UtfToExternalDString(NULL, path,
lastDir-path, &ds);
if (Realpath(nativePath, normPath) != NULL) {
- nextCheckpoint = lastDir - path;
- goto wholeStringOk;
+ if (*nativePath != '/' && *normPath == '/') {
+ /*
+ * realpath has transformed a relative path into an
+ * absolute path, we do not know how to handle this.
+ */
+ } else {
+ nextCheckpoint = lastDir - path;
+ goto wholeStringOk;
+ }
}
+ Tcl_DStringFree(&ds);
}
}