aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-12-13 22:25:28 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2018-12-13 22:25:28 +0100
commite755e30402e1e8071563e03f442998cac162f295 (patch)
tree38a010253c40fa33681fd8cc39070873f0bc4b52
parent89198a9e5d4e599a25a839c4d193f834bcd8c617 (diff)
downloadbusybox-e755e30402e1e8071563e03f442998cac162f295.tar.gz
bc: unbreak "only bc" and "only dc" configs
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--miscutils/bc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/miscutils/bc.c b/miscutils/bc.c
index 5938e54ab..1f0802a4d 100644
--- a/miscutils/bc.c
+++ b/miscutils/bc.c
@@ -1360,7 +1360,8 @@ static void bc_read_line(BcVec *vec)
if (n <= 0) { // read errors or EOF, or ^D, or ^C
if (n == 0) // ^C
goto intr;
- break;
+ bc_vec_pushZeroByte(vec);
+ return;
}
i = 0;
for (;;) {
@@ -2913,8 +2914,8 @@ static void bc_lex_file(BcLex *l)
l->newline = false;
}
-static BC_STATUS zbc_lex_token(BcLex *l);
-static BC_STATUS zdc_lex_token(BcLex *l);
+IF_BC(static BC_STATUS zbc_lex_token(BcLex *l);)
+IF_DC(static BC_STATUS zdc_lex_token(BcLex *l);)
static BC_STATUS zcommon_lex_token(BcLex *l)
{
@@ -3475,8 +3476,8 @@ static void bc_parse_number(BcParse *p, BcInst *prev, size_t *nexs)
(*prev) = BC_INST_NUM;
}
-static BC_STATUS zbc_parse_parse(BcParse *p);
-static BC_STATUS zdc_parse_parse(BcParse *p);
+IF_BC(static BC_STATUS zbc_parse_parse(BcParse *p);)
+IF_DC(static BC_STATUS zdc_parse_parse(BcParse *p);)
static BC_STATUS zcommon_parse(BcParse *p)
{