]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Fix linecounting mistake in try_digraph
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 25 Nov 2012 20:07:03 +0000 (21:07 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 25 Nov 2012 20:07:03 +0000 (21:07 +0100)
lexer.c

diff --git a/lexer.c b/lexer.c
index c7fec4468698c8824b5736af414474a4687dde55..3660190946f4b4bfd5b273a0e7a71395e78a17b2 100644 (file)
--- a/lexer.c
+++ b/lexer.c
@@ -318,6 +318,11 @@ static int lex_try_digraph(lex_file *lex, int ch)
 {
     int c2;
     c2 = lex_fgetc(lex);
+    /* we just used fgetc() so count lines
+     * need to offset a \n the ungetch would recognize
+     */
+    if (!lex->push_line && c2 == '\n')
+        lex->line++;
     if      (ch == '<' && c2 == ':')
         return '[';
     else if (ch == ':' && c2 == '>')