From: Jozsef Kadlecsik Date: Fri, 17 Dec 2010 20:43:18 +0000 (+0100) Subject: Match command prefixes X-Git-Tag: v5.0~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=33b0506702a12c48dcdfde3484dae208c4bf1158;p=thirdparty%2Fipset.git Match command prefixes Match not only the first letter or the full command name, but an arbitrary prefix too. --- diff --git a/src/ui.c b/src/ui.c index ce905324..176e1b2d 100644 --- 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;