aboutsummaryrefslogtreecommitdiff
path: root/miscutils/bc.c
diff options
context:
space:
mode:
Diffstat (limited to 'miscutils/bc.c')
-rw-r--r--miscutils/bc.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/miscutils/bc.c b/miscutils/bc.c
index 809b4bfc4..9d04ddea3 100644
--- a/miscutils/bc.c
+++ b/miscutils/bc.c
@@ -2910,25 +2910,29 @@ static bool bc_lex_more_input(void)
2910 string = G.input_buffer.v + prevlen; 2910 string = G.input_buffer.v + prevlen;
2911 while (*string) { 2911 while (*string) {
2912 char c = *string; 2912 char c = *string;
2913 if (string == G.input_buffer.v || string[-1] != '\\') { 2913 if (!comment) {
2914 if (IS_BC) 2914 if (string == G.input_buffer.v || string[-1] != '\\') {
2915 str ^= (c == '"'); 2915 if (IS_BC)
2916 else { 2916 str ^= (c == '"');
2917 if (c == ']') 2917 else {
2918 str -= 1; 2918 if (c == ']')
2919 else if (c == '[') 2919 str -= 1;
2920 str += 1; 2920 else if (c == '[')
2921 str += 1;
2922 }
2921 } 2923 }
2922 } 2924 }
2923 string++; 2925 string++;
2924 if (c == '/' && *string == '*') { 2926 if (!str) {
2925 comment = true; 2927 if (c == '/' && *string == '*') {
2926 string++; 2928 comment = true;
2927 continue; 2929 string++;
2928 } 2930 continue;
2929 if (c == '*' && *string == '/') { 2931 }
2930 comment = false; 2932 if (c == '*' && *string == '/') {
2931 string++; 2933 comment = false;
2934 string++;
2935 }
2932 } 2936 }
2933 } 2937 }
2934 if (str != 0 || comment) { 2938 if (str != 0 || comment) {