From: Wolfgang (Blub) Bumiller Date: Sun, 25 Nov 2012 20:07:03 +0000 (+0100) Subject: Fix linecounting mistake in try_digraph X-Git-Tag: 0.1.9~239 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=36cdffe1b3c8770083803214ec77c06fd773bc8e;p=xonotic%2Fgmqcc.git Fix linecounting mistake in try_digraph --- diff --git a/lexer.c b/lexer.c index c7fec44..3660190 100644 --- 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 == '>')