]> granicus.if.org Git - ipset/commitdiff
ipset help lists set types multiple times, fixed (reported by Mr Dash Four)
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Tue, 19 Jun 2012 20:24:53 +0000 (22:24 +0200)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Tue, 19 Jun 2012 20:24:53 +0000 (22:24 +0200)
ipset help listed every set type, including the ones with multiple
revisions - which were listed thus multiple times. Set types with
multiple revisions are listed once from now on.

src/ipset.c

index 8e5411ff9aa6e00b3a16703bbdc6357b88b65ada..e649f08486ac057a07b149bb9b9d298c86d44d13 100644 (file)
@@ -623,10 +623,14 @@ parse_commandline(int argc, char *argv[])
                                               type->family == NFPROTO_IPV4
                                                ? "INET" : "INET6");
                        } else {
+                               const char *name = NULL;
+
                                printf("\nSupported set types:\n");
                                type = ipset_types();
                                while (type) {
-                                       printf("    %s\n", type->name);
+                                       if (!(name && STREQ(name, type->name)))
+                                               printf("    %s\n", type->name);
+                                       name = type->name;
                                        type = type->next;
                                }
                        }