diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-12-13 17:56:35 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-12-13 17:56:35 +0100 |
commit | 818b602c8859cd935083e183eb772becc26acfb3 (patch) | |
tree | dfaa6ac37201469f3f1685e3a5e9fe9953eeb7c0 /miscutils/bc.c | |
parent | 335b4efd2f5627b52290e0a6320bab4e6b3aa568 (diff) | |
download | busybox-818b602c8859cd935083e183eb772becc26acfb3.tar.gz |
bc: fix another thinko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'miscutils/bc.c')
-rw-r--r-- | miscutils/bc.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/miscutils/bc.c b/miscutils/bc.c index a78cd591a..74847a328 100644 --- a/miscutils/bc.c +++ b/miscutils/bc.c @@ -7059,22 +7059,21 @@ static BC_STATUS zbc_vm_stdin(void) str = 0; for (;;) { size_t len; - char *string; bc_read_line(&buf); len = buf.len - 1; if (len == 0) // "" buf means EOF break; - string = buf.v; if (len == 1) { if (str && buf.v[0] == G.send) str -= 1; else if (buf.v[0] == G.sbgn) str += 1; } else { + char *string = buf.v; while (*string) { char c = *string; - if (string != buf.v && string[-1] != '\\') { + if (string == buf.v || string[-1] != '\\') { // checking applet type is cheaper than accessing sbgn/send if (IS_BC) // bc: sbgn = send = '"' str ^= (c == '"'); |