summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordas <das>2006-03-28 10:47:03 (GMT)
committerdas <das>2006-03-28 10:47:03 (GMT)
commit6944091c09865070fd6e03deafe8942a329a74fb (patch)
tree80ad203f9e9314dd34b66cad20decbb0c5609dc2
parent5a8169617edbc1477821fe1097d13b63b87d8485 (diff)
downloadtcl-6944091c09865070fd6e03deafe8942a329a74fb.zip
tcl-6944091c09865070fd6e03deafe8942a329a74fb.tar.gz
tcl-6944091c09865070fd6e03deafe8942a329a74fb.tar.bz2
* unix/tclUnixFCmd.c (TclpObjNormalizePath): deal with *BSD/Darwin
realpath() converting relative paths into absolute paths. [Bug 1064247]
-rw-r--r--ChangeLog10
-rw-r--r--unix/tclUnixFCmd.c14
2 files changed, 21 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index b8db811..e76ab1d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2006-03-28 Daniel Steffen <das@users.sourceforge.net>
+
+ * unix/tclUnixFCmd.c (TclpObjNormalizePath): deal with *BSD/Darwin
+ realpath() converting relative paths into absolute paths. [Bug 1064247]
+
+2006-03-28 Vince Darley <vincentdarley@sourceforge.net>
+
+ * generic/tclIOUtil.c: fix to nativeFilesystemRecord comparisons
+ (lesser part of [Bug 1064247])
+
2006-03-27 Pat Thoyts <patthoyts@users.sourceforge.net>
* win/tclWinTest.c: Fixes for bug #1456373 (mingw-gcc issue)
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c
index 02bd513..317eca7 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.28.2.8 2005/12/05 15:10:33 dgp Exp $
+ * RCS: @(#) $Id: tclUnixFCmd.c,v 1.28.2.9 2006/03/28 10:47:09 das Exp $
*
* Portions of this code were derived from NetBSD source code which has
* the following copyright notice:
@@ -1821,9 +1821,17 @@ TclpObjNormalizePath(interp, pathPtr, nextCheckpoint)
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);
}
}
/* Else do it the slow way */