Fix infloop in info-look.el

* lisp/info-look.el (info-lookup-guess-gdb-script-symbol): Fix
infloop when there are no completions.  (Bug#63808)
This commit is contained in:
Eli Zaretskii 2023-05-31 17:50:53 +03:00
parent 83b22139e4
commit 0a354d6578

View file

@ -733,7 +733,11 @@ Return nil if there is nothing appropriate in the buffer near point."
(let ((str (string-join str-list " ")))
(when (assoc str completions)
(throw 'result str))
(nbutlast str-list)))))))
;; 'nbutlast' will not destructively set its argument
;; to nil when the argument is a list of 1 element.
(if (= (length str-list) 1)
(setq str-list nil)
(nbutlast str-list))))))))
(error nil)))
;;;###autoload