From: Richard M. Stallman Date: Fri, 14 Jan 1994 18:06:40 +0000 (+0000) Subject: (abbreviate-file-name): Don't convert / to ~/ when the home dir is /. X-Git-Tag: emacs-19.34~10269 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ca33ccb548fe2ed658f97020ee97089c2160b72b;p=emacs.git (abbreviate-file-name): Don't convert / to ~/ when the home dir is /. --- diff --git a/lisp/files.el b/lisp/files.el index d484fddb47c..47e2d74a16a 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -545,7 +545,10 @@ Type \\[describe-variable] directory-abbrev-alist RET for more information." ;; If FILENAME starts with the abbreviated homedir, ;; make it start with `~' instead. - (if (string-match abbreviated-home-dir filename) + (if (and (string-match abbreviated-home-dir filename) + ;; If the home dir is just /, don't change it. + (not (and (= (match-end 0) 1) + (= (aref filename 0) ?/)))) (setq filename (concat "~" ;; If abbreviated-home-dir ends with a slash,