netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [nft PATCH v2] rule: delete extra space in sets printing
@ 2016-01-13 17:21 Arturo Borrero Gonzalez
  2016-03-03 18:59 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Arturo Borrero Gonzalez @ 2016-01-13 17:21 UTC (permalink / raw)
  To: netfilter-devel; +Cc: pablo

The extra space is printed when sets are printed in tabulated format.

table inet test {
	set test {
		  ^
		type ipv4_addr
	}
}

However, the space is still required in printing in plain format (ie, monitor).

Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
---
v2: use string test provided by Pablo and put an example of the problem
    in the patch description.

 src/rule.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/rule.c b/src/rule.c
index 18ff592..2f03b98 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -267,7 +267,10 @@ static void set_print_declaration(const struct set *set,
 	if (opts->table != NULL)
 		printf(" %s", opts->table);
 
-	printf(" %s { %s", set->handle.set, opts->nl);
+	printf(" %s {%s", set->handle.set, opts->nl);
+
+	if (!opts->nl[0])
+		printf(" ");
 
 	printf("%s%stype %s", opts->tab, opts->tab, set->keytype->name);
 	if (set->flags & SET_F_MAP)


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [nft PATCH v2] rule: delete extra space in sets printing
  2016-01-13 17:21 [nft PATCH v2] rule: delete extra space in sets printing Arturo Borrero Gonzalez
@ 2016-03-03 18:59 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2016-03-03 18:59 UTC (permalink / raw)
  To: Arturo Borrero Gonzalez; +Cc: netfilter-devel

On Wed, Jan 13, 2016 at 06:21:41PM +0100, Arturo Borrero Gonzalez wrote:
> The extra space is printed when sets are printed in tabulated format.
> 
> table inet test {
> 	set test {
> 		  ^
> 		type ipv4_addr
> 	}
> }
> 
> However, the space is still required in printing in plain format (ie, monitor).

Arturo, I going back in my queue of pending things (I left some stuff
behind because of NetDev 1.1).

So I'm now pushing this into the repo. Thanks for your patience.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-03 18:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-13 17:21 [nft PATCH v2] rule: delete extra space in sets printing Arturo Borrero Gonzalez
2016-03-03 18:59 ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).