]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
scanner: don't update location's line_offset for newlines
authorPatrick McHardy <kaber@trash.net>
Tue, 4 Feb 2014 08:09:27 +0000 (08:09 +0000)
committerPatrick McHardy <kaber@trash.net>
Tue, 4 Feb 2014 08:09:27 +0000 (08:09 +0000)
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 <kaber@trash.net>
src/scanner.l

index 47ab1e238291b752fab4dd3735b0594164298ff6..11965cdf9db7ad54956c32af796b31f5d0e3ee45 100644 (file)
@@ -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 {                                       \