bc: handle "limits" and "quit" immediately at parse time
authorDenys Vlasenko <vda.linux@googlemail.com>
Mon, 3 Dec 2018 13:02:35 +0000 (14:02 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Wed, 5 Dec 2018 14:43:35 +0000 (15:43 +0100)
commitcfdc1334c3e0cfbbe41f850e426c51c37a653dfb
tree36e563d437ede8e7022aec6cd23fbe140fb83d1d
parent01cabafd05410548bd7f539fb09dc3a8a9f48e08
bc: handle "limits" and "quit" immediately at parse time

No need to propagate a special exit code.

function                                             old     new   delta
bc_parse_stmt                                       2197    2301    +104
quit                                                   -      38     +38
bc_read_line                                         344     349      +5
bc_program_reset                                     174     172      -2
bc_num_s                                             252     246      -6
bc_num_a                                             454     445      -9
bc_parse_parse                                       471     461     -10
bc_num_ulong                                          95      85     -10
bc_program_exec                                     4500    4478     -22
bc_vm_run                                           2006    1978     -28
bc_vm_process                                        291     139    -152
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/8 up/down: 147/-239)          Total: -92 bytes
   text    data     bss     dec     hex filename
 987936     485    7296  995717   f3185 busybox_old
 987844     485    7296  995625   f3129 busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
miscutils/bc.c