Mercurial > emacs
changeset 50578:2bf79af13e21
From Michael Albinus <Michael.Albinus@alcatel.de>.
(ange-ftp-expand-symlink): If result of
expansion is a symlink, expand again.
(ange-ftp-file-symlink-p): Return target of symlink literally.
author | Kai Großjohann <kgrossjo@eu.uu.net> |
---|---|
date | Sun, 13 Apr 2003 12:46:11 +0000 |
parents | e5f72e7c4f4c |
children | 603b312a33d1 |
files | lisp/ChangeLog lisp/net/ange-ftp.el |
diffstat | 2 files changed, 16 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Sun Apr 13 06:30:59 2003 +0000 +++ b/lisp/ChangeLog Sun Apr 13 12:46:11 2003 +0000 @@ -1,3 +1,10 @@ +2003-04-13 Kai Gro,A_(Bjohann <kai.grossjohann@gmx.net> + From Michael Albinus <Michael.Albinus@alcatel.de>. + + * net/ange-ftp.el (ange-ftp-expand-symlink): If result of + expansion is a symlink, expand again. + (ange-ftp-file-symlink-p): Return target of symlink literally. + 2003-04-13 Masatake YAMATO <jet@gyve.org> * bindings.el (toplevel): Don't change the face
--- a/lisp/net/ange-ftp.el Sun Apr 13 06:30:59 2003 +0000 +++ b/lisp/net/ange-ftp.el Sun Apr 13 12:46:11 2003 +0000 @@ -3356,9 +3356,14 @@ (ange-ftp-real-insert-file-contents filename visit beg end replace)))) (defun ange-ftp-expand-symlink (file dir) - (if (file-name-absolute-p file) - (ange-ftp-replace-name-component dir file) - (expand-file-name file dir))) + (let ((res (if (file-name-absolute-p file) + (ange-ftp-replace-name-component dir file) + (expand-file-name file dir)))) + (if (file-symlink-p res) + (ange-ftp-expand-symlink + (ange-ftp-get-file-entry res) + (file-name-directory (directory-file-name res))) + res))) (defun ange-ftp-file-symlink-p (file) ;; call ange-ftp-expand-file-name rather than the normal @@ -3370,11 +3375,7 @@ (gethash (ange-ftp-get-file-part file) (ange-ftp-get-files (file-name-directory file))))) - (if (stringp file-ent) - (if (file-name-absolute-p file-ent) - (ange-ftp-replace-name-component - (file-name-directory file) file-ent) - file-ent))) + (and (stringp file-ent) file-ent)) (ange-ftp-real-file-symlink-p file))) (defun ange-ftp-file-exists-p (name)