From 8f51194aa5f2e3300d60bca9c7b6630ee11d9a70 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 19 Jul 2021 17:31:17 +0200 Subject: [PATCH] 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 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. -- 2.39.5