diff options
| author | Lars Ingebrigtsen | 2020-08-19 12:55:46 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2020-08-19 12:55:46 +0200 |
| commit | 9e586ac1d1b3bbabbd73a119698df742c0bfa523 (patch) | |
| tree | e550f79abad54bb0e550f9a27eeb78c7b341fe87 /src | |
| parent | dc90e62276da36af14305e0dbe1076e2d041ac4f (diff) | |
| download | emacs-9e586ac1d1b3bbabbd73a119698df742c0bfa523.tar.gz emacs-9e586ac1d1b3bbabbd73a119698df742c0bfa523.zip | |
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 <npostavs@gmail.com>.
Diffstat (limited to 'src')
| -rw-r--r-- | src/minibuf.c | 2 |
1 files changed, 1 insertions, 1 deletions
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, | |||
| 251 | else | 251 | else |
| 252 | { | 252 | { |
| 253 | xfree (line); | 253 | xfree (line); |
| 254 | error ("Error reading from stdin"); | 254 | xsignal1 (Qend_of_file, build_string ("Error reading from stdin")); |
| 255 | } | 255 | } |
| 256 | 256 | ||
| 257 | /* If Lisp form desired instead of string, parse it. */ | 257 | /* If Lisp form desired instead of string, parse it. */ |