]> git.eshelyaron.com Git - emacs.git/commitdiff
(locate-dominating-file): Wrap directory-files with condition-case, instead
authorEli Zaretskii <eliz@gnu.org>
Tue, 30 Sep 2008 12:52:46 +0000 (12:52 +0000)
committerEli Zaretskii <eliz@gnu.org>
Tue, 30 Sep 2008 12:52:46 +0000 (12:52 +0000)
of calling file-directory-p, which stats the directory one more time.

lisp/ChangeLog
lisp/files.el

index 0cc37745e43e7140acdc766df5a2b9a7e6530652..844fff225ab427caf8ba9697d6c4ea8aef6afc48 100644 (file)
@@ -1,5 +1,9 @@
 2008-09-30  Eli Zaretskii  <eliz@gnu.org>
 
+       * files.el (locate-dominating-file): Wrap directory-files with
+       condition-case, instead of calling file-directory-p, which stats
+       the directory one more time.
+
        * mail/mail-utils.el (mail-unquote-printable-region): Use
        insert-byte instead of insert-char, when the UNIBYTE arg is
        non-nil.
index f00c265ed6e2a9aabc2001252c341a31b26b8aed..090556663e648dac74454bd29b1680b52c880c44 100644 (file)
@@ -734,8 +734,9 @@ PATH-AND-SUFFIXES is a pair of lists, (DIRECTORIES . SUFFIXES)."
                   (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