diff options
| author | Jim Blandy | 1992-10-14 16:45:31 +0000 |
|---|---|---|
| committer | Jim Blandy | 1992-10-14 16:45:31 +0000 |
| commit | 6d1df4b2a426e6b846b44aa200c5d7deecc6219e (patch) | |
| tree | 0464ea38ddb17278b2bbe92689636e6dd25649c6 | |
| parent | 1e733c6f882774f380887a73a0d1165bb6fc343a (diff) | |
| download | emacs-6d1df4b2a426e6b846b44aa200c5d7deecc6219e.tar.gz emacs-6d1df4b2a426e6b846b44aa200c5d7deecc6219e.zip | |
* 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.
| -rw-r--r-- | lisp/files.el | 4 |
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." | |||
| 268 | The truename of a file name is found by chasing symbolic links | 268 | The truename of a file name is found by chasing symbolic links |
| 269 | both at the level of the file and at the level of the directories | 269 | both at the level of the file and at the level of the directories |
| 270 | containing it, until no links are left at any level." | 270 | containing it, until no links are left at any level." |
| 271 | (if (string= filename "~") | ||
| 272 | (setq filename (expand-file-name filename))) | ||
| 271 | (let ((dir (file-name-directory filename)) | 273 | (let ((dir (file-name-directory filename)) |
| 272 | target) | 274 | target) |
| 273 | ;; Get the truename of the directory. | 275 | ;; Get the truename of the directory. |
| 274 | (or (string= dir "/") | 276 | (or (string= dir "/") |
| 275 | (setq dir (file-name-as-directory (file-truename (directory-file-name dir))))) | 277 | (setq dir (file-name-as-directory (file-truename (directory-file-name dir))))) |
| 276 | ;; Put it back on the file name. | 278 | ;; Put it back on the file name. |
| 277 | (setq filename (concat (file-name-nondirectory filename) dir)) | 279 | (setq filename (concat dir (file-name-nondirectory filename))) |
| 278 | ;; Is the file name the name of a link? | 280 | ;; Is the file name the name of a link? |
| 279 | (setq target (file-symlink-p filename)) | 281 | (setq target (file-symlink-p filename)) |
| 280 | (if target | 282 | (if target |