From: Wolfgang Bumiller Date: Mon, 26 Aug 2013 16:53:09 +0000 (+0200) Subject: reset the column counter on a newline X-Git-Tag: 0.3.5~146 X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=commitdiff_plain;h=ba94df47f08acc2f2cd581956c147335ae512ecf reset the column counter on a newline --- diff --git a/lexer.c b/lexer.c index feea8a2..af7819d 100644 --- a/lexer.c +++ b/lexer.c @@ -352,14 +352,18 @@ static int lex_getch(lex_file *lex) if (lex->peekpos) { lex->peekpos--; - if (!lex->push_line && lex->peek[lex->peekpos] == '\n') + if (!lex->push_line && lex->peek[lex->peekpos] == '\n') { lex->line++; + lex->column = 0; + } return lex->peek[lex->peekpos]; } ch = lex_fgetc(lex); - if (!lex->push_line && ch == '\n') + if (!lex->push_line && ch == '\n') { lex->line++; + lex->column = 0; + } else if (ch == '?') return lex_try_trigraph(lex, ch); else if (!lex->flags.nodigraphs && (ch == '<' || ch == ':' || ch == '%'))