summaryrefslogtreecommitdiffstats
path: root/generic/tclIOUtil.c
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2004-11-23 15:23:09 (GMT)
committervincentdarley <vincentdarley>2004-11-23 15:23:09 (GMT)
commitdcc1ed1129283a3f510297869024d755b7a2c17a (patch)
tree6c4fac24b8a3f722baf807efb3f37861b7490753 /generic/tclIOUtil.c
parent59317f4e489fb79017034911d3e0fd2a01eb2b4e (diff)
downloadtcl-dcc1ed1129283a3f510297869024d755b7a2c17a.zip
tcl-dcc1ed1129283a3f510297869024d755b7a2c17a.tar.gz
tcl-dcc1ed1129283a3f510297869024d755b7a2c17a.tar.bz2
backport file join fix
Diffstat (limited to 'generic/tclIOUtil.c')
-rw-r--r--generic/tclIOUtil.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index 33884e0..3b0ed7c 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -17,7 +17,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclIOUtil.c,v 1.77.2.18 2004/06/10 14:05:24 vasiljevic Exp $
+ * RCS: @(#) $Id: tclIOUtil.c,v 1.77.2.19 2004/11/23 15:23:13 vincentdarley Exp $
*/
#include "tclInt.h"
@@ -4776,8 +4776,18 @@ Tcl_FSJoinPath(listObj, elements)
*/
if (str[0] != '.' && ((tclPlatform != TCL_PLATFORM_WINDOWS)
|| (strchr(str, '\\') == NULL))) {
- Tcl_DecrRefCount(res);
- return TclNewFSPathObj(elt, str, len);
+ /*
+ * 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);
+ }
}
/*
* Otherwise we don't have an easy join, and