From 61c12b1ae1bd6588b6dfa3ebfaa2520fd3ecc7d9 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 27 Oct 2011 14:03:15 +0000 Subject: Proposed fix for 3414754 --- generic/tclPathObj.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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; } -- cgit v0.12