summaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorDenys Vlasenko2021-07-02 14:29:01 +0200
committerDenys Vlasenko2021-07-02 14:29:01 +0200
commit1193c68fa718ff16c47aba23f8532bf1568f294e (patch)
treef16838282d43ddc0e7824b1abfa77c90f4112f94 /editors
parent40573556f2a67b11319785e0479b7087d02c060e (diff)
downloadbusybox-1193c68fa718ff16c47aba23f8532bf1568f294e.zip
busybox-1193c68fa718ff16c47aba23f8532bf1568f294e.tar.gz
awk: when parsing length(), simplify eating of LPAREN
function old new delta parse_expr 945 948 +3 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'editors')
-rw-r--r--editors/awk.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/editors/awk.c b/editors/awk.c
index 6833c2f..f65449a 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -1453,10 +1453,11 @@ static node *parse_expr(uint32_t term_tc)
| TC_BINOPX /* length <op> NUM */
| TC_COMMA /* print length, 1 */
);
- rollback_token();
- if (tc & TC_LPAREN) {
+ if (tc != TC_LPAREN)
+ rollback_token();
+ else {
/* It was a "(" token. Handle just like TC_BUILTIN */
- cn->l.n = parse_lrparen_list();
+ cn->l.n = parse_expr(TC_RPAREN);
}
break;
}