emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 95d56b92a6b: Fix 'locate-dominating-file' when FILE is not a dire


From: Eli Zaretskii
Subject: master 95d56b92a6b: Fix 'locate-dominating-file' when FILE is not a directory.
Date: Wed, 25 Oct 2023 09:12:59 -0400 (EDT)

branch: master
commit 95d56b92a6b9916e2923f8c45a93d312604f5c66
Author: dalanicolai <dalanicolai@gmail.com>
Commit: Eli Zaretskii <eliz@gnu.org>

    Fix 'locate-dominating-file' when FILE is not a directory.
    
    * lisp/files.el (locate-dominating-file): Handle FILE that is not
    a directory.  (Bug#66542)
---
 lisp/files.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lisp/files.el b/lisp/files.el
index 1be5b374ae8..3d838cd3b8c 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1135,9 +1135,11 @@ the function needs to examine, starting with FILE."
     (while (not (or root
                     (null file)
                     (string-match locate-dominating-stop-dir-regexp file)))
-      (setq try (if (stringp name)
-                    (and (file-directory-p file)
-                         (file-exists-p (expand-file-name name file)))
+      (setq file (if (file-directory-p file)
+                     file
+                   (file-name-directory file))
+            try (if (stringp name)
+                    (file-exists-p (expand-file-name name file))
                   (funcall name file)))
       (cond (try (setq root file))
             ((equal file (setq file (file-name-directory



reply via email to

[Prev in Thread] Current Thread [Next in Thread]