[hackers] [scc] [cc1] simplify readline() || Quentin Rameau

From: <git_AT_suckless.org>
Date: Wed, 22 Jun 2016 14:28:34 +0200 (CEST)

commit 8945d761a051d5bc4fcfa9fe947a9fb74f9c9641
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Wed Jun 22 14:26:21 2016 +0200
Commit: Quentin Rameau <quinq_AT_fifth.space>
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
_AT_@ -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)
Received on Wed Jun 22 2016 - 14:28:34 CEST

This archive was generated by hypermail 2.3.0 : Wed Jun 22 2016 - 14:36:14 CEST