changeset 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 e2cbba9f0ea3
children 38e8dc7fd1e8
files lisp/files.el
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
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))