From: Óscar Fuentes Date: Mon, 27 Dec 2021 15:01:09 +0000 (+0100) Subject: eshell-complete-parse-arguments: don't use string-match on a list X-Git-Tag: emacs-28.0.91~29 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ea65de757766fa4cb5a090012e2f6a0aeef0b9f8;p=emacs.git eshell-complete-parse-arguments: don't use string-match on a list 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. --- diff --git a/lisp/eshell/em-cmpl.el b/lisp/eshell/em-cmpl.el index 4fd0afbeb88..96ec031fba6 100644 --- a/lisp/eshell/em-cmpl.el +++ b/lisp/eshell/em-cmpl.el @@ -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)