From 6d1df4b2a426e6b846b44aa200c5d7deecc6219e Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Wed, 14 Oct 1992 16:45:31 +0000 Subject: * files.el (file-truename): The variable ~ should be considered an absolute pathname; handle it correctly. Concatenate the directory onto the filename in the correct order. --- lisp/files.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lisp/files.el') diff --git a/lisp/files.el b/lisp/files.el index f0da5099e6d..51dd91c0ea8 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -268,13 +268,15 @@ accessible." The truename of a file name is found by chasing symbolic links both at the level of the file and at the level of the directories containing it, until no links are left at any level." + (if (string= filename "~") + (setq filename (expand-file-name filename))) (let ((dir (file-name-directory filename)) target) ;; Get the truename of the directory. (or (string= dir "/") (setq dir (file-name-as-directory (file-truename (directory-file-name dir))))) ;; Put it back on the file name. - (setq filename (concat (file-name-nondirectory filename) dir)) + (setq filename (concat dir (file-name-nondirectory filename))) ;; Is the file name the name of a link? (setq target (file-symlink-p filename)) (if target -- cgit v1.2.1