From 9b685dfb73cdf1260d125dc254daf63a294e0687 Mon Sep 17 00:00:00 2001 From: vincentdarley Date: Mon, 24 Nov 2003 10:13:36 +0000 Subject: remove windows [cd] bug --- ChangeLog | 6 ++++++ generic/tclPathObj.c | 17 ++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5c1fc93..de404f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-11-24 Vince Darley + + * generic/tclPathObj.c: fix to [Bug 845778] - Infinite recursion + on [cd] (Windows only bug), for which new tests have just been + added. + 2003-11-21 Don Porter * tests/winFCmd.test (winFCmd-16.10,11): Merged new tests from diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c index be3ac61..40570aa 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.13 2003/11/03 12:49:11 vincentdarley Exp $ + * RCS: @(#) $Id: tclPathObj.c,v 1.14 2003/11/24 10:13:36 vincentdarley Exp $ */ #include "tclInt.h" @@ -1266,15 +1266,22 @@ Tcl_FSGetNormalizedPath(interp, pathObjPtr) } if (drive[0] == drive_c) { absolutePath = Tcl_DuplicateObj(useThisCwd); - Tcl_IncrRefCount(absolutePath); - Tcl_AppendToObj(absolutePath, "/", 1); - Tcl_AppendToObj(absolutePath, path+2, -1); /* We have a refCount on the cwd */ } else { - /* We just can't handle it correctly here */ Tcl_DecrRefCount(useThisCwd); useThisCwd = NULL; + /* + * The path is not in the current drive, but + * is volume-relative. The way Tcl 8.3 handles + * this is that it treats such a path as + * relative to the root of the drive. We + * therefore behave the same here. + */ + absolutePath = Tcl_NewStringObj(path, 2); } + Tcl_IncrRefCount(absolutePath); + Tcl_AppendToObj(absolutePath, "/", 1); + Tcl_AppendToObj(absolutePath, path+2, -1); } #endif /* __WIN32__ */ } -- cgit v0.12