From 36cdffe1b3c8770083803214ec77c06fd773bc8e Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Sun, 25 Nov 2012 21:07:03 +0100 Subject: [PATCH] Fix linecounting mistake in try_digraph --- lexer.c | 5 +++++ 1 file changed, 5 insertions(+) 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 == '>') -- 2.39.2