Index: tclFileName.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclFileName.c,v
retrieving revision 1.60
diff -b -u -r1.60 tclFileName.c
--- tclFileName.c	7 Oct 2004 14:50:21 -0000	1.60
+++ tclFileName.c	12 Jan 2005 19:08:22 -0000
@@ -2259,6 +2259,14 @@
 		    Tcl_DStringLength(&append));
 	} else {
 	    joinedPtr = Tcl_DuplicateObj(pathPtr);
+	    if (strchr(separators, Tcl_DStringValue(&append)[0]) == NULL) {
+		/* The current prefix must end in a separator */
+		int len;
+		CONST char *joined = Tcl_GetStringFromObj(joinedPtr,&len);
+		if (strchr(separators, joined[len-1]) == NULL) {
+		    Tcl_AppendToObj(joinedPtr, "/", 1);
+		}
+	    }
 	    Tcl_AppendToObj(joinedPtr, Tcl_DStringValue(&append),
 		    Tcl_DStringLength(&append));
 	}
@@ -2279,6 +2287,14 @@
 	joinedPtr = TclNewFSPathObj(pathPtr, pattern, p-pattern);
     } else {
 	joinedPtr = Tcl_DuplicateObj(pathPtr);
+	if (strchr(separators, pattern[0]) == NULL) {
+	    /* The current prefix must end in a separator */
+	    int len;
+	    CONST char *joined = Tcl_GetStringFromObj(joinedPtr,&len);
+	    if (strchr(separators, joined[len-1]) == NULL) {
+		Tcl_AppendToObj(joinedPtr, "/", 1);
+	    }
+	}
 	Tcl_AppendToObj(joinedPtr, pattern, p-pattern);
     }
 
