diff options
author | Rob Landley <rob@landley.net> | 2020-12-26 00:43:14 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2020-12-26 00:43:14 -0600 |
commit | 3bd2e82dac075cd5a79a99e3ca31dc3f9a812b08 (patch) | |
tree | 9aa74433bf3bb492b9ff734ea07b5d53c3717438 /toys/pending | |
parent | 390fa7bbf39eaf86d53c6842ad99ed7829a51cf8 (diff) | |
download | toybox-3bd2e82dac075cd5a79a99e3ca31dc3f9a812b08.tar.gz |
toysh: fix break/continue
Diffstat (limited to 'toys/pending')
-rw-r--r-- | toys/pending/sh.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/toys/pending/sh.c b/toys/pending/sh.c index 5bbe939d..14fb55cd 100644 --- a/toys/pending/sh.c +++ b/toys/pending/sh.c @@ -2337,7 +2337,6 @@ static int parse_line(char *line, struct sh_function *sp) // Ok, we have a word. What does it _mean_? // case/esac parsing is weird (unbalanced parentheses!), handle first - i = ex && !strcmp(ex, "esac") && ((pl->type && pl->type != 3) || (*start==';' && end-start>1)); if (i) { @@ -2850,7 +2849,8 @@ TODO: a | b | c needs subshell for builtins? } while (i && blk) - if (!--i && *s == 'c') pl = blk->start; + if (blk->middle && !strcmp(*blk->middle->arg->v, "do") + && !--i && *s=='c') pl = blk->start; else pl = pop_block(&blk, pipes); if (i) { syntax_err("break"); |