summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDenys Vlasenko2011-02-08 18:34:03 +0100
committerDenys Vlasenko2011-02-08 18:34:03 +0100
commit92e531458a6c0e6464fbdc1463f91edc7fb752c7 (patch)
tree72062fc0e07619658d45b88172f230fc0ab34422 /shell
parent12d97b66805f87e535962963e858fc2422ffdbc7 (diff)
downloadbusybox-92e531458a6c0e6464fbdc1463f91edc7fb752c7.zip
busybox-92e531458a6c0e6464fbdc1463f91edc7fb752c7.tar.gz
Apply post-1.18.2 fixes, bump version to 1.18.31_18_3
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
-rw-r--r--shell/hush.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/shell/hush.c b/shell/hush.c
index f9f8152..58d2c11 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -4123,15 +4123,26 @@ static struct pipe *parse_stream(char **pstring,
&& dest.length == 0 && !dest.has_quoted_part
) {
/* This newline can be ignored. But...
- * without the below check, interactive shell
- * will ignore even lines with bare <newline>,
- * and show the continuation prompt:
+ * Without check #1, interactive shell
+ * ignores even bare <newline>,
+ * and shows the continuation prompt:
* ps1_prompt$ <enter>
- * ps2> _ <=== wrong prompt, should be ps1
+ * ps2> _ <=== wrong, should be ps1
+ * Without check #2, "cmd & <newline>"
+ * is similarly mistreated.
+ * (BTW, this makes "cmd & cmd"
+ * and "cmd && cmd" non-orthogonal.
+ * Really, ask yourself, why
+ * "cmd && <newline>" doesn't start
+ * cmd but waits for more input?
+ * No reason...)
*/
struct pipe *pi = ctx.list_head;
- if (pi->num_cmds != 0)
+ if (pi->num_cmds != 0 /* check #1 */
+ && pi->followup != PIPE_BG /* check #2 */
+ ) {
continue;
+ }
}
/* Treat newline as a command separator. */
done_pipe(&ctx, PIPE_SEQ);