changeset 98413:6708b075f931

(locate-dominating-file): Wrap directory-files with condition-case, instead of calling file-directory-p, which stats the directory one more time.
author Eli Zaretskii <eliz@gnu.org>
date Tue, 30 Sep 2008 12:51:44 +0000
parents f999c89e46fd
children d97aba892b93
files lisp/files.el
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/files.el	Tue Sep 30 11:54:57 2008 +0000
+++ b/lisp/files.el	Tue Sep 30 12:51:44 2008 +0000
@@ -734,8 +734,9 @@
                   (let ((prev-user user))
                     (setq user (nth 2 (file-attributes dir)))
                     (or (null prev-user) (equal user prev-user))))
-        (if (setq files (and (file-directory-p dir)
-                             (directory-files dir 'full regexp)))
+        (if (setq files (condition-case nil
+			    (directory-files dir 'full regexp)
+			  (error nil)))
             (throw 'found (car files))
           (if (equal dir
                      (setq dir (file-name-directory