From b31e9b63ebdf9f3c03d7cdae34b49880d95332fb Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Wed, 16 Jan 2013 22:09:27 +0100 Subject: [PATCH] fix: trigraph check screwing up linenumbering --- lexer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lexer.c b/lexer.c index abb3e33..3781496 100644 --- 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 '\\';