1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-26 19:18:50 +00:00

Allow trailing whitespace in --eval argument (Bug#36219)

* lisp/startup.el (command-line-1): Don't complain about trailing
garbage if it's only space, tab, or newline characters.
This commit is contained in:
Noam Postavsky 2019-06-15 08:40:23 -04:00
parent f8b9765463
commit a1b230b58a

View File

@ -2413,7 +2413,9 @@ nil default-directory" name)
(read-data (read-from-string str-expr))
(expr (car read-data))
(end (cdr read-data)))
(unless (= end (length str-expr))
;; Allow same trailing chars as minibuf.c's
;; `string_to_object'.
(unless (string-match-p "[\s\t\n]*\\'" str-expr end)
(error "Trailing garbage following expression: %s"
(substring str-expr end)))
(eval expr t)))