diff options
author | Denys Vlasenko | 2023-05-08 12:27:50 +0200 |
---|---|---|
committer | Denys Vlasenko | 2023-05-08 12:27:50 +0200 |
commit | 3c8e540eb7b7cd3d60d55bb195e26537f83eb836 (patch) | |
tree | 8d63cf5ae3f7d5fc0e9a482e07302398bd552345 | |
parent | 40fa8eb998e27529fcd59830eb163b43658f9e81 (diff) | |
download | busybox-3c8e540eb7b7cd3d60d55bb195e26537f83eb836.zip busybox-3c8e540eb7b7cd3d60d55bb195e26537f83eb836.tar.gz |
hush: fix an interactive abort on error
function old new delta
parse_and_run_stream 140 155 +15
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | shell/hush.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/shell/hush.c b/shell/hush.c index f8951d0..ac8e447 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -7589,6 +7589,14 @@ static void parse_and_run_stream(struct in_str *inp, int end_trigger) } /* Force prompt */ inp->p = NULL; + /* Clear "peeked" EOF. Without this, + * $ { cmd }<Enter> + * > ^D + * hush: syntax error: unterminated { + * exits interactive shell: + */ + if (inp->peek_buf[0] == EOF) + inp->peek_buf[0] = 0; /* This stream isn't empty */ empty = 0; continue; |