]> git.eshelyaron.com Git - emacs.git/commitdiff
eshell-complete-parse-arguments: don't use string-match on a list
authorÓscar Fuentes <ofv@wanadoo.es>
Mon, 27 Dec 2021 15:01:09 +0000 (16:01 +0100)
committerÓscar Fuentes <ofv@wanadoo.es>
Mon, 27 Dec 2021 15:05:19 +0000 (16:05 +0100)
When there is more than one candidate for completion, `val' is a list.

Fixes bug#52794.

* lisp/eshell/em-cmpl.el (eshell-complete-parse-arguments): protect
use of string-match with stringp.

lisp/eshell/em-cmpl.el

index 4fd0afbeb8828bdfb0d69fd0ddc79b6cd3532167..96ec031fba68fda507b81b91c6bcbcd1f7a4df05 100644 (file)
@@ -382,7 +382,7 @@ to writing a completion function."
                       (setq val (number-to-string val)))
                      ;; expand .../ etc that only eshell understands to
                      ;; standard ../../
-                     ((string-match "\\.\\.\\.+/" val)
+                     ((and (stringp val)) (string-match "\\.\\.\\.+/" val)
                       (setq val (eshell-expand-multiple-dots val))))
                (or val "")))
           args)