bc: fix a thinko: dc uses [] string delimiters, bot bc!
authorDenys Vlasenko <vda.linux@googlemail.com>
Thu, 13 Dec 2018 16:46:26 +0000 (17:46 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 13 Dec 2018 16:46:26 +0000 (17:46 +0100)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
miscutils/bc.c

index dc9a7da8e3b9b3f98206685a011fdee005c0ef1a..a78cd591ad1e71c412ba114afb4881febcecdf23 100644 (file)
@@ -7076,9 +7076,9 @@ static BC_STATUS zbc_vm_stdin(void)
                                char c = *string;
                                if (string != buf.v && string[-1] != '\\') {
                                        // checking applet type is cheaper than accessing sbgn/send
-                                       if (IS_DC) // dc: sbgn = send = '"'
+                                       if (IS_BC) // bc: sbgn = send = '"'
                                                str ^= (c == '"');
-                                       else { // bc: sbgn = '[', send = ']'
+                                       else { // dc: sbgn = '[', send = ']'
                                                if (c == ']')
                                                        str -= 1;
                                                else if (c == '[')