summaryrefslogtreecommitdiff
path: root/miscutils
diff options
context:
space:
mode:
authorDenys Vlasenko2018-12-20 16:48:50 +0100
committerDenys Vlasenko2018-12-20 16:48:50 +0100
commit5acd14ba5b911aff28cb259cabdb84c5f8233e55 (patch)
treed771515f2720eac81d997996aa39d35394afc0fc /miscutils
parent503faf9d5331b70d93836d221ff12f97d769499b (diff)
downloadbusybox-5acd14ba5b911aff28cb259cabdb84c5f8233e55.zip
busybox-5acd14ba5b911aff28cb259cabdb84c5f8233e55.tar.gz
bc: fix keyword matching to not think "ifz" is the "if" keyword
function old new delta zbc_lex_next 2224 2225 +1 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'miscutils')
-rw-r--r--miscutils/bc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/miscutils/bc.c b/miscutils/bc.c
index c528810..1e2ca8b 100644
--- a/miscutils/bc.c
+++ b/miscutils/bc.c
@@ -2950,6 +2950,8 @@ static BC_STATUS zbc_lex_identifier(BcLex *l)
continue;
match:
// buf starts with keyword bc_lex_kws[i]
+ if (isalnum(buf[j]) || buf[j]=='_')
+ continue; // "ifz" does not match "if" keyword, "if." does
l->t.t = BC_LEX_KEY_1st_keyword + i;
if (!bc_lex_kws_POSIX(i)) {
s = bc_posix_error_fmt("%sthe '%.8s' keyword", "POSIX does not allow ", bc_lex_kws[i].name8);