From 685452ca4a098bbd7c1062a35064755c1d09512a Mon Sep 17 00:00:00 2001
Date: Fri, 18 Jan 2019 03:57:37 -0600
Subject: [PATCH] Fix reading EOF characters in batch mode.
* src/minibuf.c (read_minibuf_noninteractive): Handle EOF characters by
clearing stdin and returning Qnil.
---
src/minibuf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/minibuf.c b/src/minibuf.c
index 321fda1ba8..8c88a316a7 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -250,7 +250,8 @@ read_minibuf_noninteractive (Lisp_Object prompt, bool expflag,
else
{
xfree (line);
- error ("Error reading from stdin");
+ clearerr(stdin);
+ return Qnil;
}
/* If Lisp form desired instead of string, parse it. */
--
2.19.1