diff options
author | vincentdarley <vincentdarley@noemail.net> | 2002-06-27 12:27:34 (GMT) |
---|---|---|
committer | vincentdarley <vincentdarley@noemail.net> | 2002-06-27 12:27:34 (GMT) |
commit | e2b2f705af522d4875bf7c8792b421849ac67be8 (patch) | |
tree | dff037214125bb866ef5becad1d4e39993ba0b07 /unix | |
parent | 645cb488ce9df75913558a0559d21ab977bc41db (diff) | |
download | tcl-e2b2f705af522d4875bf7c8792b421849ac67be8.zip tcl-e2b2f705af522d4875bf7c8792b421849ac67be8.tar.gz tcl-e2b2f705af522d4875bf7c8792b421849ac67be8.tar.bz2 |
unix root volume fix
FossilOrigin-Name: 09b4b3bd7bbfc13edcbaf994f747ca1332577c9a
Diffstat (limited to 'unix')
-rw-r--r-- | unix/tclUnixFCmd.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c index 37921fc..51e354e 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.23 2002/06/10 17:41:52 vincentdarley Exp $ + * RCS: @(#) $Id: tclUnixFCmd.c,v 1.24 2002/06/27 12:27:35 vincentdarley Exp $ * * Portions of this code were derived from NetBSD source code which has * the following copyright notice: @@ -1692,7 +1692,6 @@ TclpObjNormalizePath(interp, pathPtr, nextCheckpoint) nextCheckpoint = currentPathEndPosition - path; } else if (cur == 0) { /* Reached end of string */ - /* nextCheckpoint = pathLen; */ break; } currentPathEndPosition++; @@ -1705,6 +1704,14 @@ TclpObjNormalizePath(interp, pathPtr, nextCheckpoint) * have 'realpath'. */ #ifndef NO_REALPATH + /* + * If we only had '/foo' or '/' then we never increment nextCheckpoint + * and we don't need or want to go through 'Realpath'. Also, on some + * platforms, passing an empty string to 'Realpath' will give us the + * normalized pwd, which is not what we want at all! + */ + if (nextCheckpoint == 0) return 0; + nativePath = Tcl_UtfToExternalDString(NULL, path, nextCheckpoint, &ds); if (Realpath(nativePath, normPath) != NULL) { /* |