From d279d809ac0f1c41c358e9ad72ea5d0b606ae47c Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 24 Dec 2018 18:28:56 +0100 Subject: [PATCH] bc: fix "bc -s" only warning on "define f()", not exiting Signed-off-by: Denys Vlasenko --- miscutils/bc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) s = zbc_lex_next(&p->l); if (s) RETURN_STATUS(s); - if (p->l.t.t != BC_LEX_LBRACE) + if (p->l.t.t != BC_LEX_LBRACE) { s = zbc_POSIX_requires("the left brace be on the same line as the function header"); + if (s) RETURN_STATUS(s); + } // Prevent "define z()" from being interpreted as function with empty stmt as body s = zbc_lex_skip_if_at_NLINE(&p->l); -- 2.25.1