← Commit list

3c8e540eb

Denys Vlasenko
Denys Vlasenko
2023-05-08
SUCCESS Duration: 159s

Subject

hush: fix an interactive abort on error

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

shell/hush.c+8 -0
@@ -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;