summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2004-11-22 12:53:04 (GMT)
committervincentdarley <vincentdarley>2004-11-22 12:53:04 (GMT)
commit5264c8ea7beb50e85b079617502d7ef7296a5188 (patch)
tree3637c6ed0321468290c7f2b3e0c04c7bf2ece6e8 /generic
parentc5de95ef4f7261b14f8ff65e8bef6ec08967f12d (diff)
downloadtcl-5264c8ea7beb50e85b079617502d7ef7296a5188.zip
tcl-5264c8ea7beb50e85b079617502d7ef7296a5188.tar.gz
tcl-5264c8ea7beb50e85b079617502d7ef7296a5188.tar.bz2
fix to windows file join bug
Diffstat (limited to 'generic')
-rw-r--r--generic/tclPathObj.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index 26d5e70..2ed8eed 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.37 2004/10/07 14:50:23 vincentdarley Exp $
+ * RCS: @(#) $Id: tclPathObj.c,v 1.38 2004/11/22 12:53:06 vincentdarley Exp $
*/
#include "tclInt.h"
@@ -842,10 +842,18 @@ Tcl_FSJoinPath(listObj, elements)
if (str[0] != '.' && ((tclPlatform != TCL_PLATFORM_WINDOWS)
|| (strchr(str, '\\') == NULL))) {
- if (res != NULL) {
- TclDecrRefCount(res);
+ /*
+ * Finally, on Windows, 'file join' is defined to
+ * convert all backslashes to forward slashes,
+ * so the base part cannot have backslashes either.
+ */
+ if ((tclPlatform != TCL_PLATFORM_WINDOWS)
+ || (strchr(Tcl_GetString(elt), '\\') == NULL)) {
+ if (res != NULL) {
+ TclDecrRefCount(res);
+ }
+ return TclNewFSPathObj(elt, str, len);
}
- return TclNewFSPathObj(elt, str, len);
}
/*