diff options
Diffstat (limited to 'miscutils/bc.c')
-rw-r--r-- | miscutils/bc.c | 13 |
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) | |||
5054 | BcParse *p = &G.prs; | 5054 | BcParse *p = &G.prs; |
5055 | int i; | 5055 | int i; |
5056 | 5056 | ||
5057 | if (p->lex == XC_LEX_NLINE) | ||
5058 | RETURN_STATUS(zxc_lex_next()); | ||
5059 | |||
5057 | i = (int)p->lex - (int)XC_LEX_OP_POWER; | 5060 | i = (int)p->lex - (int)XC_LEX_OP_POWER; |
5058 | if (i >= 0) { | 5061 | if (i >= 0) { |
5059 | BcInst inst = dc_LEX_to_INST[i]; | 5062 | BcInst inst = dc_LEX_to_INST[i]; |
@@ -6766,14 +6769,6 @@ static BC_STATUS zxc_vm_process(const char *text) | |||
6766 | #endif | 6769 | #endif |
6767 | } else { | 6770 | } else { |
6768 | #if ENABLE_DC | 6771 | #if ENABLE_DC |
6769 | // Most of dc parsing assumes all whitespace, | ||
6770 | // including '\n', is eaten. | ||
6771 | while (G.prs.lex == XC_LEX_NLINE) { | ||
6772 | s = zxc_lex_next(); | ||
6773 | if (s) goto err; | ||
6774 | if (G.prs.lex == XC_LEX_EOF) | ||
6775 | goto done; | ||
6776 | } | ||
6777 | s = zdc_parse_expr(); | 6772 | s = zdc_parse_expr(); |
6778 | #endif | 6773 | #endif |
6779 | } | 6774 | } |
@@ -6836,7 +6831,7 @@ static BC_STATUS zxc_vm_process(const char *text) | |||
6836 | bc_vec_pop_all(&f->code); | 6831 | bc_vec_pop_all(&f->code); |
6837 | ip->inst_idx = 0; | 6832 | ip->inst_idx = 0; |
6838 | } | 6833 | } |
6839 | IF_DC(done:) | 6834 | |
6840 | dbg_lex_done("%s:%d done", __func__, __LINE__); | 6835 | dbg_lex_done("%s:%d done", __func__, __LINE__); |
6841 | RETURN_STATUS(s); | 6836 | RETURN_STATUS(s); |
6842 | } | 6837 | } |