aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/subcmd/help.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <[email protected]>2017-07-20 18:27:39 +0000
committerArnaldo Carvalho de Melo <[email protected]>2017-07-20 18:46:10 +0000
commit8e99b6d4533cf3f49dcd813155a513a5b572baef (patch)
treef3f082ab6d3e1916353b59e7f70735183cc72722 /tools/lib/subcmd/help.c
parentperf trace: Filter out 'sshd' in the tracer ancestry in syswide tracing (diff)
downloadkernel-8e99b6d4533cf3f49dcd813155a513a5b572baef.tar.gz
kernel-8e99b6d4533cf3f49dcd813155a513a5b572baef.zip
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 <[email protected]> Cc: David Ahern <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Josh Poimboeuf <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Rusty Russell <[email protected]> Cc: Wang Nan <[email protected]> Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/lib/subcmd/help.c')
-rw-r--r--tools/lib/subcmd/help.c2
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,
while ((de = readdir(dir)) != NULL) {
int entlen;
- if (prefixcmp(de->d_name, prefix))
+ if (!strstarts(de->d_name, prefix))
continue;
astrcat(&buf, de->d_name);