diff lisp/files.el @ 1406:62dae4a3c7fb

* 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.
author Jim Blandy <jimb@redhat.com>
date Wed, 14 Oct 1992 16:45:31 +0000
parents f6f838c4a26e
children fb2d16111e4b
line wrap: on
line diff
--- a/lisp/files.el	Tue Oct 13 17:55:42 1992 +0000
+++ b/lisp/files.el	Wed Oct 14 16:45:31 1992 +0000
@@ -268,13 +268,15 @@
 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