Fixed bug with "/*"
authorceriel <none@none>
Mon, 15 Nov 1993 09:29:39 +0000 (09:29 +0000)
committerceriel <none@none>
Mon, 15 Nov 1993 09:29:39 +0000 (09:29 +0000)
util/cpp/skip.c

index de2be7e..3416b75 100644 (file)
@@ -62,6 +62,28 @@ skipline()
 
        LoadChar(c);
        while (class(c) != STNL && c != EOI) {
+               if (class(c) == STSTR || class(c) == STCHAR) {
+                       register int stopc = c;
+                       int escaped;
+                       do {
+                               escaped = 0;
+                               LoadChar(c);
+                               if (class(c) == STNL || c == EOI) {
+                                       break;
+                               }
+                               if (c == '\\') {
+                                       LoadChar(c);
+                                       if (c == '\n') {
+                                               ++LineNumber;
+                                       }
+                                       else escaped = 1;
+                               }
+                       } while (escaped || c != stopc);
+                       if (class(c) != STNL && c != EOI) {
+                               LoadChar(c);
+                       }
+                       continue;
+               }
                if (c == '\\') {
                        LoadChar(c);
                        if (class(c) == STNL)