From 9e586ac1d1b3bbabbd73a119698df742c0bfa523 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Wed, 19 Aug 2020 12:55:46 +0200 Subject: [PATCH] Signal an end-of-file error upon errors when reading from stdin * src/minibuf.c (read_minibuf_noninteractive): Signal an `end-of-file' error when reading from stdin instead of a general error (bug#34123). This makes it easier to write code that recovers from this situation. Suggested by Noam Postavsky . --- src/minibuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/minibuf.c b/src/minibuf.c index cb302c5a605..e18ff17abbf 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -251,7 +251,7 @@ read_minibuf_noninteractive (Lisp_Object prompt, bool expflag, else { xfree (line); - error ("Error reading from stdin"); + xsignal1 (Qend_of_file, build_string ("Error reading from stdin")); } /* If Lisp form desired instead of string, parse it. */ -- 2.39.5