diff options
author | Phil Sutter <phil@nwl.cc> | 2018-09-11 22:14:26 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2018-09-13 10:42:35 +0200 |
commit | cbbdb960a262d8df86a2dfaa1b56c0182e97f3ed (patch) | |
tree | 5a9b4f7c7c99156a09e2e2c8cc91c44bb45ab0ee /src/json.c | |
parent | 758f8bd61bcad7809d776881bc1f8de0b2fab2e2 (diff) |
json: Print range expressions numerically
This applies the same change as in commit 85b1e3c0052ef ("src: Always
print range expressions numerically") to JSON output for consistency.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'src/json.c')
-rw-r--r-- | src/json.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -393,9 +393,15 @@ json_t *relational_expr_json(const struct expr *expr, struct output_ctx *octx) json_t *range_expr_json(const struct expr *expr, struct output_ctx *octx) { - return json_pack("{s:[o, o]}", "range", + json_t *root; + + octx->numeric += NFT_NUMERIC_ALL + 1; + root = json_pack("{s:[o, o]}", "range", expr_print_json(expr->left, octx), expr_print_json(expr->right, octx)); + octx->numeric -= NFT_NUMERIC_ALL + 1; + + return root; } json_t *meta_expr_json(const struct expr *expr, struct output_ctx *octx) |