[git commit] hush: fix an interactive abort on error

Denys Vlasenko vda.linux at googlemail.com
Mon May 8 10:27:50 UTC 2023


commit: https://git.busybox.net/busybox/commit/?id=3c8e540eb7b7cd3d60d55bb195e26537f83eb836
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

function                                             old     new   delta
parse_and_run_stream                                 140     155     +15

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 shell/hush.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/shell/hush.c b/shell/hush.c
index f8951d084..ac8e44778 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;


More information about the busybox-cvs mailing list