summaryrefslogtreecommitdiffstats
path: root/generic/tclPathObj.c
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2004-03-26 18:45:09 (GMT)
committervincentdarley <vincentdarley>2004-03-26 18:45:09 (GMT)
commitdbf0dda330688becb98f2c5eb2e87878f80487cf (patch)
tree8fabafd735a40f93836eeb0060ee8bce9a5cfedc /generic/tclPathObj.c
parent658bfb282ce6fcba3cdf53d7448e7fa3e3fa05ac (diff)
downloadtcl-dbf0dda330688becb98f2c5eb2e87878f80487cf.zip
tcl-dbf0dda330688becb98f2c5eb2e87878f80487cf.tar.gz
tcl-dbf0dda330688becb98f2c5eb2e87878f80487cf.tar.bz2
fix to windows volume-relative path normalization
Diffstat (limited to 'generic/tclPathObj.c')
-rw-r--r--generic/tclPathObj.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index cd3f9f9..2be2a7e 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.25 2004/03/17 18:14:14 das Exp $
+ * RCS: @(#) $Id: tclPathObj.c,v 1.26 2004/03/26 18:45:10 vincentdarley Exp $
*/
#include "tclInt.h"
@@ -1690,6 +1690,11 @@ Tcl_FSGetNormalizedPath(interp, pathPtr)
if (drive[0] == drive_cur) {
absolutePath = Tcl_DuplicateObj(useThisCwd);
/* We have a refCount on the cwd */
+
+ if (drive[cwdLen-1] != '/') {
+ /* Only add a trailing '/' if needed */
+ Tcl_AppendToObj(absolutePath, "/", 1);
+ }
} else {
Tcl_DecrRefCount(useThisCwd);
useThisCwd = NULL;
@@ -1701,12 +1706,9 @@ Tcl_FSGetNormalizedPath(interp, pathPtr)
* therefore behave the same here.
*/
absolutePath = Tcl_NewStringObj(path, 2);
+ Tcl_AppendToObj(absolutePath, "/", 1);
}
Tcl_IncrRefCount(absolutePath);
- if (drive[cwdLen-1] != '/') {
- /* Only add a trailing '/' if needed */
- Tcl_AppendToObj(absolutePath, "/", 1);
- }
Tcl_AppendToObj(absolutePath, path+2, -1);
}
#endif /* __WIN32__ */