diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-12-13 17:46:26 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-12-13 17:46:26 +0100 |
commit | 335b4efd2f5627b52290e0a6320bab4e6b3aa568 (patch) | |
tree | 9ec918bd506c2800331e18640dcfea5808cb0cbb | |
parent | 766f67250f01dc5458093c31ec0d2ec09cad65a2 (diff) | |
download | busybox-w32-335b4efd2f5627b52290e0a6320bab4e6b3aa568.tar.gz busybox-w32-335b4efd2f5627b52290e0a6320bab4e6b3aa568.tar.bz2 busybox-w32-335b4efd2f5627b52290e0a6320bab4e6b3aa568.zip |
bc: fix a thinko: dc uses [] string delimiters, bot bc!
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | miscutils/bc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/miscutils/bc.c b/miscutils/bc.c index dc9a7da8e..a78cd591a 100644 --- a/miscutils/bc.c +++ b/miscutils/bc.c | |||
@@ -7076,9 +7076,9 @@ static BC_STATUS zbc_vm_stdin(void) | |||
7076 | char c = *string; | 7076 | char c = *string; |
7077 | if (string != buf.v && string[-1] != '\\') { | 7077 | if (string != buf.v && string[-1] != '\\') { |
7078 | // checking applet type is cheaper than accessing sbgn/send | 7078 | // checking applet type is cheaper than accessing sbgn/send |
7079 | if (IS_DC) // dc: sbgn = send = '"' | 7079 | if (IS_BC) // bc: sbgn = send = '"' |
7080 | str ^= (c == '"'); | 7080 | str ^= (c == '"'); |
7081 | else { // bc: sbgn = '[', send = ']' | 7081 | else { // dc: sbgn = '[', send = ']' |
7082 | if (c == ']') | 7082 | if (c == ']') |
7083 | str -= 1; | 7083 | str -= 1; |
7084 | else if (c == '[') | 7084 | else if (c == '[') |