aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>2003-07-07 20:55:38 +0000
committerRichard M. Stallman <[email protected]>2003-07-07 20:55:38 +0000
commit34301ace3d23760e4a9fddfaf53f386faa375029 (patch)
tree5b3874f4b56465ee1f2830c6b8a9e4aaa998966d
parent654805e39d5ea62a3dba5b516655cb6a412110ed (diff)
(ange-ftp-file-symlink-p):
Use condition-case to catch error in ange-ftp-get-files.
-rw-r--r--lisp/net/ange-ftp.el16
1 files changed, 11 insertions, 5 deletions
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el
index ca5cb193bd..a315482fd1 100644
--- a/lisp/net/ange-ftp.el
+++ b/lisp/net/ange-ftp.el
@@ -3371,11 +3371,17 @@ system TYPE.")
;; redefines both file-symlink-p and expand-file-name.
(setq file (ange-ftp-expand-file-name file))
(if (ange-ftp-ftp-name file)
- (let ((file-ent
- (gethash
- (ange-ftp-get-file-part file)
- (ange-ftp-get-files (file-name-directory file)))))
- (and (stringp file-ent) file-ent))
+ (condition-case nil
+ (let ((file-ent
+ (gethash
+ (ange-ftp-get-file-part file)
+ (ange-ftp-get-files (file-name-directory file)))))
+ (and (stringp file-ent) file-ent))
+ ;; If we can't read the parent directory, just assume
+ ;; this file is not a symlink.
+ ;; This makes it possible to access a directory that
+ ;; whose parent is not readable.
+ (file-error nil))
(ange-ftp-real-file-symlink-p file)))
(defun ange-ftp-file-exists-p (name)