aboutsummaryrefslogtreecommitdiff
path: root/miscutils
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2019-01-04 05:41:47 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2019-01-04 05:41:47 +0100
commit6842c6062a201cc34a262b4c450cf8e1374e9e3a (patch)
treee065483955285b3a6fdc3748c067efc2f0e2f3b7 /miscutils
parent377cc97b193204595d00a0b8d0d2b52c2d596586 (diff)
downloadbusybox-6842c6062a201cc34a262b4c450cf8e1374e9e3a.tar.gz
dc: fix '?'
function old new delta zdc_parse_expr 470 479 +9 zxc_vm_process 839 814 -25 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 9/-25) Total: -16 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'miscutils')
-rw-r--r--miscutils/bc.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/miscutils/bc.c b/miscutils/bc.c
index ec3560c2b..1e8056c01 100644
--- a/miscutils/bc.c
+++ b/miscutils/bc.c
@@ -5054,6 +5054,9 @@ static BC_STATUS zdc_parse_expr(void)
BcParse *p = &G.prs;
int i;
+ if (p->lex == XC_LEX_NLINE)
+ RETURN_STATUS(zxc_lex_next());
+
i = (int)p->lex - (int)XC_LEX_OP_POWER;
if (i >= 0) {
BcInst inst = dc_LEX_to_INST[i];
@@ -6766,14 +6769,6 @@ static BC_STATUS zxc_vm_process(const char *text)
#endif
} else {
#if ENABLE_DC
- // Most of dc parsing assumes all whitespace,
- // including '\n', is eaten.
- while (G.prs.lex == XC_LEX_NLINE) {
- s = zxc_lex_next();
- if (s) goto err;
- if (G.prs.lex == XC_LEX_EOF)
- goto done;
- }
s = zdc_parse_expr();
#endif
}
@@ -6836,7 +6831,7 @@ static BC_STATUS zxc_vm_process(const char *text)
bc_vec_pop_all(&f->code);
ip->inst_idx = 0;
}
- IF_DC(done:)
+
dbg_lex_done("%s:%d done", __func__, __LINE__);
RETURN_STATUS(s);
}