changeset 3624:386094c1a569

(abbreviate-file-name): Make abbreviated-home-dir from `~/', not from just `~'.
author Richard M. Stallman <rms@gnu.org>
date Thu, 10 Jun 1993 20:44:12 +0000
parents 739ba36097c9
children 57174f9b1870
files lisp/files.el
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/files.el	Thu Jun 10 20:35:05 1993 +0000
+++ b/lisp/files.el	Thu Jun 10 20:44:12 1993 +0000
@@ -509,10 +509,12 @@
     ;; Compute and save the abbreviated homedir name.
     ;; We defer computing this until the first time it's needed, to
     ;; give time for directory-abbrev-alist to be set properly.
+    ;; We include a slash at the end, to avoid spurious matches
+    ;; such as `/usr/foobar' when the home dir is `/usr/foo'.
     (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)