All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gopal Yadav <gopunop@gmail.com>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH] Solves Bug 1388 - Combining --terse with --json has no effect
Date: Fri, 11 Sep 2020 23:04:57 +0530	[thread overview]
Message-ID: <CAAUOv8iVoKLZxx1xGVLj-=k4pSNyES5SWaaScx=17WV789Kw3Q@mail.gmail.com> (raw)

Solves Bug 1388 - Combining --terse with --json has no effect

Signed-off-by: Gopal Yadav <gopunop@gmail.com>
---
 src/json.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/json.c b/src/json.c
index a9f5000f..702cf6eb 100644
--- a/src/json.c
+++ b/src/json.c
@@ -147,7 +147,8 @@ static json_t *set_print_json(struct output_ctx
*octx, const struct set *set)
         list_for_each_entry(i, &set->init->expressions, list)
             json_array_append_new(array, expr_print_json(i, octx));

-        json_object_set_new(root, "elem", array);
+        if (!(octx->flags & NFT_CTX_OUTPUT_TERSE))
+            json_object_set_new(root, "elem", array);
     }

     return json_pack("{s:o}", type, root);
-- 
2.20.1

             reply	other threads:[~2020-09-11 17:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-11 17:34 Gopal Yadav [this message]
2020-09-14 10:46 ` [PATCH] Solves Bug 1388 - Combining --terse with --json has no effect Pablo Neira Ayuso
2020-09-16 13:37   ` Gopal Yadav
2020-09-16 14:44     ` Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAUOv8iVoKLZxx1xGVLj-=k4pSNyES5SWaaScx=17WV789Kw3Q@mail.gmail.com' \
    --to=gopunop@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.