aboutsummaryrefslogtreecommitdiff
path: root/miscutils
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-12-21 00:35:22 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2018-12-21 00:35:22 +0100
commit52caa007e3f32225b6cd9f899480362c4563b023 (patch)
treebb44c017ba5aafc819d5723b60ddb27728bfd1d3 /miscutils
parent047154472ac41ddf45ed57d9bc294fbf9057cbad (diff)
downloadbusybox-w32-52caa007e3f32225b6cd9f899480362c4563b023.tar.gz
busybox-w32-52caa007e3f32225b6cd9f899480362c4563b023.tar.bz2
busybox-w32-52caa007e3f32225b6cd9f899480362c4563b023.zip
bc: for(;;) fix from upstream
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'miscutils')
-rw-r--r--miscutils/bc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/miscutils/bc.c b/miscutils/bc.c
index d37417f11..e7983f38d 100644
--- a/miscutils/bc.c
+++ b/miscutils/bc.c
@@ -4205,8 +4205,14 @@ static BC_STATUS zbc_parse_for(BcParse *p)
4205 4205
4206 if (p->l.t.t != BC_LEX_SCOLON) 4206 if (p->l.t.t != BC_LEX_SCOLON)
4207 s = zbc_parse_expr(p, BC_PARSE_REL); 4207 s = zbc_parse_expr(p, BC_PARSE_REL);
4208 else 4208 else {
4209 // Set this for the next call to bc_parse_number.
4210 // This is safe to set because the current token is a semicolon,
4211 // which has no string requirement.
4212 bc_vec_string(&p->l.t.v, 1, "1");
4213 bc_parse_pushNUM(p);
4209 s = bc_POSIX_does_not_allow_empty_X_expression_in_for("condition"); 4214 s = bc_POSIX_does_not_allow_empty_X_expression_in_for("condition");
4215 }
4210 4216
4211 if (s) RETURN_STATUS(s); 4217 if (s) RETURN_STATUS(s);
4212 if (p->l.t.t != BC_LEX_SCOLON) RETURN_STATUS(bc_error_bad_token()); 4218 if (p->l.t.t != BC_LEX_SCOLON) RETURN_STATUS(bc_error_bad_token());