]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow trailing whitespace in --eval argument (Bug#36219)
authorNoam Postavsky <npostavs@gmail.com>
Sat, 15 Jun 2019 12:40:23 +0000 (08:40 -0400)
committerNoam Postavsky <npostavs@gmail.com>
Sat, 15 Jun 2019 21:05:56 +0000 (17:05 -0400)
* lisp/startup.el (command-line-1): Don't complain about trailing
garbage if it's only space, tab, or newline characters.

lisp/startup.el

index 90046389d16ac999dc555818cffce1931a19a845..7759ed5aed320cd933ec1c3d8712edcb3d4b6b64 100644 (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)))