From f65dbda6595f5fe33f263767c37e78871770e06c Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Sun, 25 Nov 2012 18:13:46 +0100 Subject: [PATCH] linecounting fix for push/pop(line) pragmas --- lexer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; -- 2.39.2