]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
rule: simplify ("rule: delete extra space in sets printing")
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 4 Mar 2016 09:23:21 +0000 (10:23 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 4 Mar 2016 10:13:46 +0000 (11:13 +0100)
This simplifies bd23f7628570 ("rule: delete extra space in sets printing")
by passing the whitespace from set_print_plain() called from the monitoring
path.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Acked-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
src/rule.c

index 2f03b9859ecec45d001e978faa9a6402eb22a2e4..0b7854953489c33daae445c680feb3ffdc4e6d0b 100644 (file)
@@ -269,9 +269,6 @@ static void set_print_declaration(const struct set *set,
 
        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)
                printf(" : %s", set->datatype->name);
@@ -352,7 +349,7 @@ void set_print_plain(const struct set *s)
 {
        struct print_fmt_options opts = {
                .tab            = "",
-               .nl             = "",
+               .nl             = " ",
                .table          = s->handle.table,
                .family         = family2str(s->handle.family),
                .stmt_separator = ";",