]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
rule: delete extra space in sets printing
authorArturo Borrero <arturo.borrero.glez@gmail.com>
Wed, 13 Jan 2016 17:21:41 +0000 (18:21 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 3 Mar 2016 18:54:45 +0000 (19:54 +0100)
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>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/rule.c

index 18ff5920411ea4097f12cc45533d949189b4bb0d..2f03b9859ecec45d001e978faa9a6402eb22a2e4 100644 (file)
@@ -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)