From: Phil Sutter Date: Mon, 24 Jun 2019 17:10:37 +0000 (+0200) Subject: json: Print newline at end of list output X-Git-Tag: v0.9.2~73 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=51c5feaeaa0052facbd0e9ebc89faa9484a6c2b9;p=thirdparty%2Fnftables.git json: Print newline at end of list output If listing ruleset elements with '-j' flag, print a final newline to not upset shell prompts. Suggested-by: Pablo Neira Ayuso Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- diff --git a/src/json.c b/src/json.c index 4e646842..1484c21b 100644 --- a/src/json.c +++ b/src/json.c @@ -1752,6 +1752,8 @@ int do_command_list_json(struct netlink_ctx *ctx, struct cmd *cmd) root = json_pack("{s:o}", "nftables", root); json_dumpf(root, ctx->nft->output.output_fp, 0); json_decref(root); + fprintf(ctx->nft->output.output_fp, "\n"); + fflush(ctx->nft->output.output_fp); return 0; }