emacs-diffs
[Top][All Lists]
Advanced

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

master 8f51194: Fix infloop in woman-file-name


From: Lars Ingebrigtsen
Subject: master 8f51194: Fix infloop in woman-file-name
Date: Mon, 19 Jul 2021 11:31:24 -0400 (EDT)

branch: master
commit 8f51194aa5f2e3300d60bca9c7b6630ee11d9a70
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Fix infloop in woman-file-name
    
    * lisp/woman.el (woman-file-name): Fix infloop for non-existent
    manual page (bug#414).
---
 lisp/woman.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/woman.el b/lisp/woman.el
index d9aa573..0bc992d 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -1274,9 +1274,11 @@ cache to be re-read."
        ;; Complete topic more carefully, i.e. use the completion
        ;; rather than the string entered by the user:
        ((setq files (all-completions topic woman-topic-all-completions))
-       (while (/= (length topic) (length (car files)))
+       (while (and files
+                    (/= (length topic) (length (car files))))
          (setq files (cdr files)))
-       (setq files (woman-file-name-all-completions (car files)))))
+        (when files
+         (setq files (woman-file-name-all-completions (car files))))))
       (cond
        ((null files) nil)              ; no file found for topic.
        ((null (cdr files)) (car (car files))) ; only 1 file for topic.



reply via email to

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