summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2013-04-22 19:58:54 +0200
committerPatrick McHardy <kaber@trash.net>2013-04-22 19:58:54 +0200
commit1ea565b95524e160742c5ab4807907f07bd35504 (patch)
tree279cf7a308ec5f13e02ae8fb30e1732a6581c896 /src
parent2e27ad8122fe20db802e1c7bb9d5f4ad6cd23665 (diff)
parser: include leading '.' in concat subexpression location
Make error messages point to the entire subexpression. Before: filter output ip daddr . tcp dport . tcp dport { 192.168.0.1 . ssh . ssh . ssh} ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^ After: filter output ip daddr . tcp dport . tcp dport { 192.168.0.1 . ssh . ssh . ssh} ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^ Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'src')
-rw-r--r--src/parser.y6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/parser.y b/src/parser.y
index 166cbcc5..ff8ca0d0 100644
--- a/src/parser.y
+++ b/src/parser.y
@@ -1078,6 +1078,12 @@ concat_expr : basic_expr
$$ = concat_expr_alloc(&@$);
compound_expr_add($$, $1);
} else {
+ struct location rhs[] = {
+ [1] = @2,
+ [2] = @3,
+ };
+ location_update(&$3->location, rhs, 2);
+
$$ = $1;
$$->location = @$;
}