mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-27 14:12:36 +00:00
fix: trigraph check screwing up linenumbering
This commit is contained in:
parent
81f3a6d186
commit
b31e9b63eb
1 changed files with 4 additions and 0 deletions
4
lexer.c
4
lexer.c
|
@ -291,12 +291,16 @@ static int lex_try_trigraph(lex_file *lex, int old)
|
||||||
{
|
{
|
||||||
int c2, c3;
|
int c2, c3;
|
||||||
c2 = lex_fgetc(lex);
|
c2 = lex_fgetc(lex);
|
||||||
|
if (!lex->push_line && c2 == '\n')
|
||||||
|
lex->line++;
|
||||||
if (c2 != '?') {
|
if (c2 != '?') {
|
||||||
lex_ungetch(lex, c2);
|
lex_ungetch(lex, c2);
|
||||||
return old;
|
return old;
|
||||||
}
|
}
|
||||||
|
|
||||||
c3 = lex_fgetc(lex);
|
c3 = lex_fgetc(lex);
|
||||||
|
if (!lex->push_line && c3 == '\n')
|
||||||
|
lex->line++;
|
||||||
switch (c3) {
|
switch (c3) {
|
||||||
case '=': return '#';
|
case '=': return '#';
|
||||||
case '/': return '\\';
|
case '/': return '\\';
|
||||||
|
|
Loading…
Reference in a new issue