From: Patrick McHardy Date: Tue, 4 Feb 2014 08:09:27 +0000 (+0000) Subject: scanner: don't update location's line_offset for newlines X-Git-Tag: v0.2~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=585dd18242cec44564eaaee3071ff77c658cfa4d;p=thirdparty%2Fnftables.git scanner: don't update location's line_offset for newlines When reset_pos() is invoked, YY_USER_ACTION() has already advanced the line offset to the next line. This causes errors for unexpected newlines to incorrectly show the following line when reading from files. Signed-off-by: Patrick McHardy --- diff --git a/src/scanner.l b/src/scanner.l index 47ab1e23..11965cdf 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -88,7 +88,6 @@ static void reset_pos(struct parser_state *state, struct location *loc) state->indesc->line_offset = state->indesc->token_offset; state->indesc->lineno += 1; state->indesc->column = 1; - loc->line_offset = state->indesc->line_offset; } #define YY_USER_ACTION { \