diff options
| author | Noam Postavsky | 2019-06-15 08:40:23 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2019-06-15 17:05:56 -0400 |
| commit | a1b230b58a4176a574bcb37573c82d1ccc71633c (patch) | |
| tree | 6fb692b2f753c9489ed2211da10b705045da8f27 | |
| parent | f8b976546344e69728925753c2e41d31a04fe6c4 (diff) | |
| download | emacs-a1b230b58a4176a574bcb37573c82d1ccc71633c.tar.gz emacs-a1b230b58a4176a574bcb37573c82d1ccc71633c.zip | |
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.
| -rw-r--r-- | lisp/startup.el | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/startup.el b/lisp/startup.el index 90046389d16..7759ed5aed3 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -2413,7 +2413,9 @@ nil default-directory" name) | |||
| 2413 | (read-data (read-from-string str-expr)) | 2413 | (read-data (read-from-string str-expr)) |
| 2414 | (expr (car read-data)) | 2414 | (expr (car read-data)) |
| 2415 | (end (cdr read-data))) | 2415 | (end (cdr read-data))) |
| 2416 | (unless (= end (length str-expr)) | 2416 | ;; Allow same trailing chars as minibuf.c's |
| 2417 | ;; `string_to_object'. | ||
| 2418 | (unless (string-match-p "[\s\t\n]*\\'" str-expr end) | ||
| 2417 | (error "Trailing garbage following expression: %s" | 2419 | (error "Trailing garbage following expression: %s" |
| 2418 | (substring str-expr end))) | 2420 | (substring str-expr end))) |
| 2419 | (eval expr t))) | 2421 | (eval expr t))) |