aboutsummaryrefslogtreecommitdiff
path: root/shell/hush.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/hush.c')
-rw-r--r--shell/hush.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 533d45ac3..4b8641d19 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -4980,8 +4980,14 @@ static struct pipe *parse_stream(char **pstring,
4980 nommu_addchr(&ctx.as_string, ch); 4980 nommu_addchr(&ctx.as_string, ch);
4981 4981
4982 next = '\0'; 4982 next = '\0';
4983 if (ch != '\n') 4983 if (ch != '\n') {
4984 next = i_peek(input); 4984 next = i_peek(input);
4985 /* Can't use i_peek_and_eat_bkslash_nl(input) here:
4986 * echo '\
4987 * '
4988 * will break.
4989 */
4990 }
4985 4991
4986 is_special = "{}<>;&|()#'" /* special outside of "str" */ 4992 is_special = "{}<>;&|()#'" /* special outside of "str" */
4987 "\\$\"" IF_HUSH_TICK("`") /* always special */ 4993 "\\$\"" IF_HUSH_TICK("`") /* always special */
@@ -5375,7 +5381,7 @@ static struct pipe *parse_stream(char **pstring,
5375 /* Eat multiple semicolons, detect 5381 /* Eat multiple semicolons, detect
5376 * whether it means something special */ 5382 * whether it means something special */
5377 while (1) { 5383 while (1) {
5378 ch = i_peek(input); 5384 ch = i_peek_and_eat_bkslash_nl(input);
5379 if (ch != ';') 5385 if (ch != ';')
5380 break; 5386 break;
5381 ch = i_getch(input); 5387 ch = i_getch(input);
@@ -5397,6 +5403,8 @@ static struct pipe *parse_stream(char **pstring,
5397 if (done_word(&dest, &ctx)) { 5403 if (done_word(&dest, &ctx)) {
5398 goto parse_error; 5404 goto parse_error;
5399 } 5405 }
5406 if (next == '\\')
5407 next = i_peek_and_eat_bkslash_nl(input);
5400 if (next == '&') { 5408 if (next == '&') {
5401 ch = i_getch(input); 5409 ch = i_getch(input);
5402 nommu_addchr(&ctx.as_string, ch); 5410 nommu_addchr(&ctx.as_string, ch);
@@ -5413,6 +5421,8 @@ static struct pipe *parse_stream(char **pstring,
5413 if (ctx.ctx_res_w == RES_MATCH) 5421 if (ctx.ctx_res_w == RES_MATCH)
5414 break; /* we are in case's "word | word)" */ 5422 break; /* we are in case's "word | word)" */
5415#endif 5423#endif
5424 if (next == '\\')
5425 next = i_peek_and_eat_bkslash_nl(input);
5416 if (next == '|') { /* || */ 5426 if (next == '|') { /* || */
5417 ch = i_getch(input); 5427 ch = i_getch(input);
5418 nommu_addchr(&ctx.as_string, ch); 5428 nommu_addchr(&ctx.as_string, ch);