diff lisp/files.el @ 3709:09e961c82be8

(abbreviate-file-name): Match home dir with no / if nothing else follows.
author Richard M. Stallman <rms@gnu.org>
date Sun, 13 Jun 1993 01:57:02 +0000
parents 3eaec128c91e
children e3a00a940cf4
line wrap: on
line diff
--- a/lisp/files.el	Sun Jun 13 01:36:48 1993 +0000
+++ b/lisp/files.el	Sun Jun 13 01:57:02 1993 +0000
@@ -520,7 +520,9 @@
     (or abbreviated-home-dir
 	(setq abbreviated-home-dir
 	      (let ((abbreviated-home-dir "$foo"))
-		(concat "^" (abbreviate-file-name (expand-file-name "~/"))))))
+		(concat "^" (abbreviate-file-name (expand-file-name "~"))
+			"\\(/\\|$\\)"))))
+						  
     ;; If FILENAME starts with the abbreviated homedir,
     ;; make it start with `~' instead.
     (if (string-match abbreviated-home-dir filename)
@@ -536,6 +538,7 @@
 				       (1- (length abbreviated-home-dir))))
 			  "/"
 			"")
+		      (substring filename (match-beginning 1) (match-end 1))
 		      (substring filename (match-end 0)))))
     filename))