]> granicus.if.org Git - ipset/commitdiff
Match command prefixes
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Fri, 17 Dec 2010 20:43:18 +0000 (21:43 +0100)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Fri, 17 Dec 2010 20:43:18 +0000 (21:43 +0100)
Match not only the first letter or the full command name, but
an arbitrary prefix too.

src/ui.c

index ce905324989c7fb7a6ef0dc40fd29218b9ee1593..176e1b2d77c5b4cb75e5d4b9361a100925f2c614 100644 (file)
--- a/src/ui.c
+++ b/src/ui.c
@@ -143,7 +143,7 @@ ipset_match_cmd(const char *arg, const char * const name[])
 
        if (len > strlen(name[0]) || !len)
                return false;
-       else if (strcmp(arg, name[0]) == 0)
+       else if (strncmp(arg, name[0], len) == 0)
                return true;
        else if (len != 1)
                return false;