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 | |
| parent | 335b4efd2f5627b52290e0a6320bab4e6b3aa568 (diff) | |
| download | busybox-w32-818b602c8859cd935083e183eb772becc26acfb3.tar.gz busybox-w32-818b602c8859cd935083e183eb772becc26acfb3.tar.bz2 busybox-w32-818b602c8859cd935083e183eb772becc26acfb3.zip | |
bc: fix another thinko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'miscutils')
| -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) | |||
| 7059 | str = 0; | 7059 | str = 0; |
| 7060 | for (;;) { | 7060 | for (;;) { |
| 7061 | size_t len; | 7061 | size_t len; |
| 7062 | char *string; | ||
| 7063 | 7062 | ||
| 7064 | bc_read_line(&buf); | 7063 | bc_read_line(&buf); |
| 7065 | len = buf.len - 1; | 7064 | len = buf.len - 1; |
| 7066 | if (len == 0) // "" buf means EOF | 7065 | if (len == 0) // "" buf means EOF |
| 7067 | break; | 7066 | break; |
| 7068 | string = buf.v; | ||
| 7069 | if (len == 1) { | 7067 | if (len == 1) { |
| 7070 | if (str && buf.v[0] == G.send) | 7068 | if (str && buf.v[0] == G.send) |
| 7071 | str -= 1; | 7069 | str -= 1; |
| 7072 | else if (buf.v[0] == G.sbgn) | 7070 | else if (buf.v[0] == G.sbgn) |
| 7073 | str += 1; | 7071 | str += 1; |
| 7074 | } else { | 7072 | } else { |
| 7073 | char *string = buf.v; | ||
| 7075 | while (*string) { | 7074 | while (*string) { |
| 7076 | char c = *string; | 7075 | char c = *string; |
| 7077 | if (string != buf.v && string[-1] != '\\') { | 7076 | if (string == buf.v || string[-1] != '\\') { |
| 7078 | // checking applet type is cheaper than accessing sbgn/send | 7077 | // checking applet type is cheaper than accessing sbgn/send |
| 7079 | if (IS_BC) // bc: sbgn = send = '"' | 7078 | if (IS_BC) // bc: sbgn = send = '"' |
| 7080 | str ^= (c == '"'); | 7079 | str ^= (c == '"'); |
