From 3415b6eed2f921a4281a7068919eda93c6b26099 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Tue, 9 Mar 2010 22:27:41 +0000 Subject: [PATCH] fix wrong line numbers in error messages [r27284] --- lexer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) { -- 2.20.1