[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master a1b230b 1/3: Allow trailing whitespace in --eval ar
From: |
Noam Postavsky |
Subject: |
[Emacs-diffs] master a1b230b 1/3: Allow trailing whitespace in --eval argument (Bug#36219) |
Date: |
Sat, 15 Jun 2019 17:25:54 -0400 (EDT) |
branch: master
commit a1b230b58a4176a574bcb37573c82d1ccc71633c
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>
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.
---
lisp/startup.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lisp/startup.el b/lisp/startup.el
index 9004638..7759ed5 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -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)))