commit 8945d761a051d5bc4fcfa9fe947a9fb74f9c9641
Author:     Quentin Rameau <[email protected]>
AuthorDate: Wed Jun 22 14:26:21 2016 +0200
Commit:     Quentin Rameau <[email protected]>
CommitDate: Wed Jun 22 14:27:17 2016 +0200

    [cc1] simplify readline()

diff --git a/cc1/lex.c b/cc1/lex.c
index 7f4a6f8..946af62 100644
--- a/cc1/lex.c
+++ b/cc1/lex.c
@@ -201,17 +201,11 @@ repeat:
                peekc = 0;
                if (c == '\n' || c == '\0')
                        break;
-               if (c != '/')
+               if (c != '/' || (peekc = readchar()) != '*' && peekc != '/')
                        continue;
-               if ((c = readchar()) != '*' && c != '/') {
-                       peekc = c;
-                       c = '/';
-               } else {
-                       if (c == '/')
-                               c = '\n';
-                       comment(c);
-                       c = ' ';
-               }
+               comment((peekc == '/') ? '\n' : peekc);
+               peekc = 0;
+               c = ' ';
        }
 
        if (bp == lim)

Reply via email to