summaryrefslogtreecommitdiffstats
path: root/generic/tclPathObj.c
diff options
context:
space:
mode:
authordgp@users.sourceforge.net <dgp>2011-10-27 14:03:15 (GMT)
committerdgp@users.sourceforge.net <dgp>2011-10-27 14:03:15 (GMT)
commit6cc633d315f11be9a80dd75ca498e08d3eb21b71 (patch)
treee477205ee006ca0927446fb29b09c9d7c13dec67 /generic/tclPathObj.c
parent1605e16e4b9e330a404114983bf1df37e39dcb4d (diff)
downloadtcl-6cc633d315f11be9a80dd75ca498e08d3eb21b71.zip
tcl-6cc633d315f11be9a80dd75ca498e08d3eb21b71.tar.gz
tcl-6cc633d315f11be9a80dd75ca498e08d3eb21b71.tar.bz2
Proposed fix for 3414754
Diffstat (limited to 'generic/tclPathObj.c')
-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;
}