diff options
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) | |||
| 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 == '"'); |
