]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
fix: trigraph check screwing up linenumbering
authorWolfgang Bumiller <blub@speed.at>
Wed, 16 Jan 2013 21:09:27 +0000 (22:09 +0100)
committerWolfgang Bumiller <blub@speed.at>
Wed, 16 Jan 2013 21:09:27 +0000 (22:09 +0100)
lexer.c

diff --git a/lexer.c b/lexer.c
index abb3e33ef27f054eb40cfe3ad1ddcba5ca50a7fc..3781496927cdbc5b31209f92389130148ca0c72e 100644 (file)
--- a/lexer.c
+++ b/lexer.c
@@ -291,12 +291,16 @@ static int lex_try_trigraph(lex_file *lex, int old)
 {
     int c2, c3;
     c2 = lex_fgetc(lex);
+    if (!lex->push_line && c2 == '\n')
+        lex->line++;
     if (c2 != '?') {
         lex_ungetch(lex, c2);
         return old;
     }
 
     c3 = lex_fgetc(lex);
+    if (!lex->push_line && c3 == '\n')
+        lex->line++;
     switch (c3) {
         case '=': return '#';
         case '/': return '\\';