From: Matthias Braun Date: Tue, 9 Mar 2010 22:27:41 +0000 (+0000) Subject: fix wrong line numbers in error messages X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=3415b6eed2f921a4281a7068919eda93c6b26099;p=cparser fix wrong line numbers in error messages [r27284] --- diff --git a/lexer.c b/lexer.c index 4ff847d..99dd4e6 100644 --- 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) {