bc: fix comment handling
[oweals/busybox.git] / miscutils / bc.c
index 9c7e69fc182795dc08fc9b9ced2273dc39f79efe..dc9a7da8e3b9b3f98206685a011fdee005c0ef1a 100644 (file)
@@ -7088,10 +7088,13 @@ static BC_STATUS zbc_vm_stdin(void)
                                string++;
                                if (c == '/' && *string == '*') {
                                        comment = true;
-                                       break;
+                                       string++;
+                                       continue;
                                }
-                               if (c == '*' && *string == '/')
+                               if (c == '*' && *string == '/') {
                                        comment = false;
+                                       string++;
+                               }
                        }
                        if (str || comment || string[-2] == '\\') {
                                bc_vec_concat(&buffer, buf.v);