diff options
author | vincentdarley <vincentdarley@noemail.net> | 2004-11-23 15:23:08 (GMT) |
---|---|---|
committer | vincentdarley <vincentdarley@noemail.net> | 2004-11-23 15:23:08 (GMT) |
commit | dcb02c94a103a326c77322dbd630617612a906b2 (patch) | |
tree | 6c4fac24b8a3f722baf807efb3f37861b7490753 /generic/tclIOUtil.c | |
parent | d33a2216d241593b9fd72640063179d6bfcf6952 (diff) | |
download | tcl-dcb02c94a103a326c77322dbd630617612a906b2.zip tcl-dcb02c94a103a326c77322dbd630617612a906b2.tar.gz tcl-dcb02c94a103a326c77322dbd630617612a906b2.tar.bz2 |
backport file join fix
FossilOrigin-Name: 1a608efe04dca17b50f0e4659c5ab304237050e7
Diffstat (limited to 'generic/tclIOUtil.c')
-rw-r--r-- | generic/tclIOUtil.c | 16 |
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 |