diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-12-24 18:28:56 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-12-24 18:28:56 +0100 |
commit | d279d809ac0f1c41c358e9ad72ea5d0b606ae47c (patch) | |
tree | 7c19dc6b484c7b6d29c7ff664a82160318287c48 | |
parent | 79587cb442d022bf8d9e388398834270785d2049 (diff) | |
download | busybox-w32-d279d809ac0f1c41c358e9ad72ea5d0b606ae47c.tar.gz busybox-w32-d279d809ac0f1c41c358e9ad72ea5d0b606ae47c.tar.bz2 busybox-w32-d279d809ac0f1c41c358e9ad72ea5d0b606ae47c.zip |
bc: fix "bc -s" only warning on "define f()<newline>", not exiting
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | miscutils/bc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/miscutils/bc.c b/miscutils/bc.c index 12bc80b3e..35778ff1c 100644 --- a/miscutils/bc.c +++ b/miscutils/bc.c | |||
@@ -4426,8 +4426,10 @@ static BC_STATUS zbc_parse_funcdef(BcParse *p) | |||
4426 | s = zbc_lex_next(&p->l); | 4426 | s = zbc_lex_next(&p->l); |
4427 | if (s) RETURN_STATUS(s); | 4427 | if (s) RETURN_STATUS(s); |
4428 | 4428 | ||
4429 | if (p->l.t.t != BC_LEX_LBRACE) | 4429 | if (p->l.t.t != BC_LEX_LBRACE) { |
4430 | s = zbc_POSIX_requires("the left brace be on the same line as the function header"); | 4430 | s = zbc_POSIX_requires("the left brace be on the same line as the function header"); |
4431 | if (s) RETURN_STATUS(s); | ||
4432 | } | ||
4431 | 4433 | ||
4432 | // Prevent "define z()<newline>" from being interpreted as function with empty stmt as body | 4434 | // Prevent "define z()<newline>" from being interpreted as function with empty stmt as body |
4433 | s = zbc_lex_skip_if_at_NLINE(&p->l); | 4435 | s = zbc_lex_skip_if_at_NLINE(&p->l); |