bc: undo debugging change, add a small optimization
authorDenys Vlasenko <vda.linux@googlemail.com>
Wed, 26 Dec 2018 20:01:41 +0000 (21:01 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Wed, 26 Dec 2018 20:01:41 +0000 (21:01 +0100)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
miscutils/bc.c

index cf04e9ff1fe81e735151439e7a9bd9b1a8c8fdc3..af94981ecac0dcdc70c8f89848def08f6602b8cb 100644 (file)
@@ -3016,7 +3016,7 @@ static BC_STATUS zbc_lex_string(void)
        for (;;) {
                char c = peek_inbuf(); // strings can cross lines
                if (c == '\0') {
-                       RETURN_STATUS(bc_error("unterminated string1"));
+                       RETURN_STATUS(bc_error("unterminated string"));
                }
                if (c == '"')
                        break;
@@ -3060,7 +3060,7 @@ static BC_STATUS zbc_lex_comment(void)
  check_star:
                if (c == '*') {
                        p->lex_inbuf++;
-                       c = peek_inbuf();
+                       c = *p->lex_inbuf; // no need to peek_inbuf()
                        if (c == '/')
                                break;
                        goto check_star;