Index: generic/tclFileName.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclFileName.c,v
retrieving revision 1.36
diff -b -u -r1.36 tclFileName.c
--- generic/tclFileName.c	30 May 2002 09:27:11 -0000	1.36
+++ generic/tclFileName.c	30 May 2002 17:53:11 -0000
@@ -2129,8 +2129,16 @@
 			elt = Tcl_NewStringObj("/",1);
 		    }
 		} else {
+		    if (oldStr[prefixLen] == '~') {
+			/* Need to quote the tilde with a './' */
+			elt = Tcl_NewStringObj(".", 1);
+			Tcl_AppendToObj(elt, separators, 1);
+			Tcl_AppendToObj(elt, oldStr + prefixLen, 
+					len - prefixLen);
+		    } else {
 		    elt = Tcl_NewStringObj(oldStr + prefixLen, 
 						len - prefixLen);
+		    }
 		}
 	    } else {
 		elt = objv[i];
Index: generic/tclIOUtil.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclIOUtil.c,v
retrieving revision 1.45
diff -b -u -r1.45 tclIOUtil.c
--- generic/tclIOUtil.c	28 May 2002 15:05:22 -0000	1.45
+++ generic/tclIOUtil.c	30 May 2002 17:54:01 -0000
@@ -1873,8 +1873,16 @@
 			for (i = 0; i < resLength; i++) {
 			    Tcl_ListObjIndex(interp, tmpResultPtr, i, &elt);
 			    eltStr = Tcl_GetStringFromObj(elt,&eltLen);
+			    if (eltStr[cwdLen] == '~') {
+				/* Need to quote the tilde with a './' */
+				cutElt = Tcl_NewStringObj(".", 1);
+				Tcl_AppendToObj(cutElt, &sep, 1);
+				Tcl_AppendToObj(cutElt, eltStr + cwdLen,
+						eltLen - cwdLen);
+			    } else {
 			    cutElt = Tcl_NewStringObj(eltStr + cwdLen,
 				    eltLen - cwdLen);
+			    }
 			    Tcl_ListObjAppendElement(interp, result, cutElt);
 			}
 		    }
