From: Wolfgang (Blub) Bumiller Date: Sun, 25 Nov 2012 17:13:46 +0000 (+0100) Subject: linecounting fix for push/pop(line) pragmas X-Git-Tag: 0.1.9~258 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f65dbda6595f5fe33f263767c37e78871770e06c;p=xonotic%2Fgmqcc.git linecounting fix for push/pop(line) pragmas --- diff --git a/lexer.c b/lexer.c index 175d158..17af7b6 100644 --- a/lexer.c +++ b/lexer.c @@ -445,7 +445,8 @@ static bool lex_try_pragma(lex_file *lex) if (!strcmp(command, "push")) { if (!strcmp(param, "line")) { lex->push_line++; - --line; + if (lex->push_line == 1) + --line; } else goto unroll; @@ -454,7 +455,8 @@ static bool lex_try_pragma(lex_file *lex) if (!strcmp(param, "line")) { if (lex->push_line) lex->push_line--; - --line; + if (lex->push_line == 0) + --line; } else goto unroll;