From: Lars Ingebrigtsen Date: Mon, 19 Jul 2021 15:31:17 +0000 (+0200) Subject: Fix infloop in woman-file-name X-Git-Tag: emacs-28.0.90~1807 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8f51194aa5f2e3300d60bca9c7b6630ee11d9a70;p=emacs.git Fix infloop in woman-file-name * lisp/woman.el (woman-file-name): Fix infloop for non-existent manual page (bug#414). --- diff --git a/lisp/woman.el b/lisp/woman.el index d9aa573d27b..0bc992d8f7f 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.