[PATCH 2/8] scanner: don't update location's line_offset for newlines

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 src/scanner.l | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/scanner.l b/src/scanner.l
index 47ab1e2..11965cd 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 {					\
-- 
1.8.5.3

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux