summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2003-12-17 09:55:11 (GMT)
committervincentdarley <vincentdarley>2003-12-17 09:55:11 (GMT)
commit55f33bb6ae4422f56b3b765f9b04884287fb3376 (patch)
treef0b0d4db30a39cfa070e26716ca00228c455f387 /generic
parentd8e0f63d57a4fe64f5d531d6906be615718944aa (diff)
downloadtcl-55f33bb6ae4422f56b3b765f9b04884287fb3376.zip
tcl-55f33bb6ae4422f56b3b765f9b04884287fb3376.tar.gz
tcl-55f33bb6ae4422f56b3b765f9b04884287fb3376.tar.bz2
fix to fs norm bug 860402
Diffstat (limited to 'generic')
-rw-r--r--generic/tclPathObj.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index db469bc..ae089bc 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.17 2003/12/17 09:25:26 vasiljevic Exp $
+ * RCS: @(#) $Id: tclPathObj.c,v 1.18 2003/12/17 09:55:11 vincentdarley Exp $
*/
#include "tclInt.h"
@@ -181,7 +181,10 @@ TclFSNormalizeAbsolutePath(interp, pathPtr, clientDataPtr)
*/
while (*dirSep != 0) {
oldDirSep = dirSep;
- dirSep += 1+FindSplitPos(dirSep+1, '/');
+ if (!first) {
+ dirSep++;
+ }
+ dirSep += FindSplitPos(dirSep, '/');
if (dirSep[0] == 0 || dirSep[1] == 0) {
if (retVal != NULL) {
Tcl_AppendToObj(retVal, oldDirSep, dirSep - oldDirSep);
@@ -216,7 +219,7 @@ TclFSNormalizeAbsolutePath(interp, pathPtr, clientDataPtr)
retVal = Tcl_NewStringObj(path, dirSep - path);
Tcl_IncrRefCount(retVal);
}
- if (!first) {
+ if (!first || (tclPlatform == TCL_PLATFORM_UNIX)) {
link = Tcl_FSLink(retVal, NULL, 0);
if (link != NULL) {
/* Got a link */
@@ -236,7 +239,7 @@ TclFSNormalizeAbsolutePath(interp, pathPtr, clientDataPtr)
linkStr = Tcl_GetStringFromObj(retVal, &curLen);
}
/* Either way, we now remove the last path element */
- while (--curLen > 0) {
+ while (--curLen >= 0) {
if (IsSeparatorOrNull(linkStr[curLen])) {
Tcl_SetObjLength(retVal, curLen);
break;