summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2003-11-24 10:13:36 (GMT)
committervincentdarley <vincentdarley>2003-11-24 10:13:36 (GMT)
commit9b685dfb73cdf1260d125dc254daf63a294e0687 (patch)
tree8c75bb5584759e3d887dcab8e7249ba62634b0b2
parent02e16cc061e4a3b26a4a8c634359348d4b54b51c (diff)
downloadtcl-9b685dfb73cdf1260d125dc254daf63a294e0687.zip
tcl-9b685dfb73cdf1260d125dc254daf63a294e0687.tar.gz
tcl-9b685dfb73cdf1260d125dc254daf63a294e0687.tar.bz2
remove windows [cd] bug
-rw-r--r--ChangeLog6
-rw-r--r--generic/tclPathObj.c17
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 <vincentdarley@users.sourceforge.net>
+
+ * 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 <dgp@users.sourceforge.net>
* 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__ */
}