summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2011-10-27 14:03:15 (GMT)
committerdgp <dgp@users.sourceforge.net>2011-10-27 14:03:15 (GMT)
commit61c12b1ae1bd6588b6dfa3ebfaa2520fd3ecc7d9 (patch)
treee477205ee006ca0927446fb29b09c9d7c13dec67
parent5ca626b4e6d4c45aa0ba1798b382251f70625de7 (diff)
downloadtcl-61c12b1ae1bd6588b6dfa3ebfaa2520fd3ecc7d9.zip
tcl-61c12b1ae1bd6588b6dfa3ebfaa2520fd3ecc7d9.tar.gz
tcl-61c12b1ae1bd6588b6dfa3ebfaa2520fd3ecc7d9.tar.bz2
Proposed fix for 3414754
-rw-r--r--generic/tclPathObj.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index 8840e4a..ab5c4e6 100644
--- a/generic/tclPathObj.c
+++ b/generic/tclPathObj.c
@@ -1367,6 +1367,22 @@ AppendPath(
const char *bytes;
Tcl_Obj *copy = Tcl_DuplicateObj(head);
+#if 1
+ /*
+ * This is likely buggy when dealing with virtual filesystem drivers
+ * that use some character other than "/" as a path separator. I know
+ * of no evidence that such a foolish thing exists. This solution was
+ * chosen so that "JoinPath" operations that pass through either path
+ * intrep produce the same results; that is, bugward compatibility. If
+ * we need to fix that bug here, it needs fixing in Tcl_FSJoinPath() too.
+ */
+ bytes = Tcl_GetStringFromObj(tail, &numBytes);
+ if (numBytes == 0) {
+ Tcl_AppendToObj(copy, "/", 1);
+ } else {
+ TclpNativeJoinPath(copy, bytes);
+ }
+#else
bytes = Tcl_GetStringFromObj(copy, &numBytes);
/*
@@ -1398,6 +1414,7 @@ AppendPath(
}
Tcl_AppendObjToObj(copy, tail);
+#endif
return copy;
}