Fix infloop in woman-file-name

* lisp/woman.el (woman-file-name): Fix infloop for non-existent
manual page (bug#414).
This commit is contained in:
Lars Ingebrigtsen 2021-07-19 17:31:17 +02:00
parent 4ffa928b93
commit 8f51194aa5

View file

@ -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.