fix wrong line numbers in error messages
authorMatthias Braun <matze@braunis.de>
Tue, 9 Mar 2010 22:27:41 +0000 (22:27 +0000)
committerMatthias Braun <matze@braunis.de>
Tue, 9 Mar 2010 22:27:41 +0000 (22:27 +0000)
[r27284]

lexer.c

diff --git a/lexer.c b/lexer.c
index 4ff847d..99dd4e6 100644 (file)
--- a/lexer.c
+++ b/lexer.c
@@ -1242,7 +1242,8 @@ static void parse_line_directive(void)
        if (pp_token.type != T_INTEGER) {
                parse_error("expected integer");
        } else {
-               lexer_token.source_position.linenr = atoi(pp_token.literal.begin);
+               /* use offset -1 as this is about the next line */
+               lexer_token.source_position.linenr = atoi(pp_token.literal.begin) - 1;
                next_pp_token();
        }
        if (pp_token.type == T_STRING_LITERAL) {