]> git.eshelyaron.com Git - emacs.git/commitdiff
(ange-ftp-file-symlink-p):
authorRichard M. Stallman <rms@gnu.org>
Mon, 7 Jul 2003 20:55:38 +0000 (20:55 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 7 Jul 2003 20:55:38 +0000 (20:55 +0000)
Use condition-case to catch error in ange-ftp-get-files.

lisp/net/ange-ftp.el

index ca5cb193bde023c0647b88efb2225c734084bf14..a315482fd1eaaff242fcb6da0d45c50519425321 100644 (file)
@@ -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)