summaryrefslogtreecommitdiff
path: root/lisp/files.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2008-09-30 12:52:46 +0000
committerEli Zaretskii <eliz@gnu.org>2008-09-30 12:52:46 +0000
commita03c5807a3b781f963c249ee2c7d55ef1633eac6 (patch)
treee889af976c1ab679fd0498b1579d906517004167 /lisp/files.el
parentf45de83bf8fd3d3a475e77afff4dee434400187e (diff)
downloademacs-a03c5807a3b781f963c249ee2c7d55ef1633eac6.tar.gz
(locate-dominating-file): Wrap directory-files with condition-case, instead
of calling file-directory-p, which stats the directory one more time.
Diffstat (limited to 'lisp/files.el')
-rw-r--r--lisp/files.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/files.el b/lisp/files.el
index f00c265ed6e..090556663e6 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -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