changeset 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 45d463eff0b3
children 0f214040f708
files lisp/files.el
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
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