awk: replace incorrect use of union in undefined function check (no code changes)

...which reveals that it's buggy: it thinks "func f(){}" is an undefined function!

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2021-06-30 12:12:20 +02:00
parent 6cf6f1eaee
commit 86fc2872b3

View File

@ -2912,7 +2912,7 @@ static var *evaluate(node *op, var *res)
debug_printf_eval("FUNC\n");
if (!op->r.n->info && !op->r.f->body.first)
if (op->r.f->nargs == 0 && !op->r.f->body.first)
syntax_error(EMSG_UNDEF_FUNC);
/* The body might be empty, still has to eval the args */