diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-07-20 14:27:39 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-07-20 14:46:10 -0400 |
commit | 8e99b6d4533cf3f49dcd813155a513a5b572baef (patch) | |
tree | f3f082ab6d3e1916353b59e7f70735183cc72722 /tools/lib/subcmd/help.c | |
parent | 082ab9a18e532864d1ceecfb50221df62b1d5a92 (diff) |
tools include: Adopt strstarts() from the kernel
Replacing prefixcmp(), same purpose, inverted result, so standardize on
the kernel variant, to reduce silly differences among tools/ and the
kernel sources, making it easier for people to work in both codebases.
And then doing:
if (strstarts(option, "no-"))
Looks clearer than doing:
if (!prefixcmp(option, "no-"))
To figure out if option starts witn "no-".
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-kaei42gi7lpa8subwtv7eug8@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib/subcmd/help.c')
-rw-r--r-- | tools/lib/subcmd/help.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/lib/subcmd/help.c b/tools/lib/subcmd/help.c index ba970a73d053..0310520f918e 100644 --- a/tools/lib/subcmd/help.c +++ b/tools/lib/subcmd/help.c | |||
@@ -171,7 +171,7 @@ static void list_commands_in_dir(struct cmdnames *cmds, | |||
171 | while ((de = readdir(dir)) != NULL) { | 171 | while ((de = readdir(dir)) != NULL) { |
172 | int entlen; | 172 | int entlen; |
173 | 173 | ||
174 | if (prefixcmp(de->d_name, prefix)) | 174 | if (!strstarts(de->d_name, prefix)) |
175 | continue; | 175 | continue; |
176 | 176 | ||
177 | astrcat(&buf, de->d_name); | 177 | astrcat(&buf, de->d_name); |