summaryrefslogtreecommitdiff
path: root/lisp/files.el
diff options
context:
space:
mode:
authorJim Blandy <jimb@redhat.com>1992-10-14 16:45:31 +0000
committerJim Blandy <jimb@redhat.com>1992-10-14 16:45:31 +0000
commit6d1df4b2a426e6b846b44aa200c5d7deecc6219e (patch)
tree0464ea38ddb17278b2bbe92689636e6dd25649c6 /lisp/files.el
parent1e733c6f882774f380887a73a0d1165bb6fc343a (diff)
downloademacs-6d1df4b2a426e6b846b44aa200c5d7deecc6219e.tar.gz
* 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.
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 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