summaryrefslogtreecommitdiff
path: root/lisp/files.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1993-06-10 20:44:12 +0000
committerRichard M. Stallman <rms@gnu.org>1993-06-10 20:44:12 +0000
commite98dda89869c4aee4291c9976cac54af56ffd835 (patch)
tree885e9d71095db6e9d4f20ff769e1d1e51e4e7433 /lisp/files.el
parenta6c5a8dd703e64d102e90363e9dd44c187c9c862 (diff)
downloademacs-e98dda89869c4aee4291c9976cac54af56ffd835.tar.gz
(abbreviate-file-name): Make abbreviated-home-dir
from `~/', not from just `~'.
Diffstat (limited to 'lisp/files.el')
-rw-r--r--lisp/files.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/files.el b/lisp/files.el
index b7cbb96db2b..37ad1c980bc 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -509,10 +509,12 @@ Type \\[describe-variable] directory-abbrev-alist RET for more information."
;; 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)