commit 18ab3f16b5df956072ca9de86967136e5dbdc330
Author:     Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Thu Jun 23 08:51:56 2016 +0200
Commit:     Roberto E. Vargas Caballero <[email protected]>
CommitDate: Thu Jun 23 08:51:56 2016 +0200

    [cc1] Simplify comment()

diff --git a/cc1/lex.c b/cc1/lex.c
index 946af62..7e51d8d 100644
--- a/cc1/lex.c
+++ b/cc1/lex.c
@@ -166,18 +166,14 @@ comment(int type)
        c = -1;
 repeat:
        do {
-               if (!c)
-                       goto unterminated;
-       } while (!eof && (c = readchar()) != type);
+               if (!c || eof) {
+                       errorp("unterminated comment");
+                       return;
+               }
+       } while ((c = readchar()) != type);
 
-       if (eof)
-               goto unterminated;
        if (type == '*' && (c = readchar()) != '/')
                goto repeat;
-       return;
-
-unterminated:
-       errorp("unterminated comment");
 }
 
 static int

Reply via email to