提交 af98f227 编写于 作者: N Namhyung Kim 提交者: Arnaldo Carvalho de Melo

perf help: Fix a bug during strstart() conversion

The commit 8e99b6d4 changed prefixcmp() to strstart() but missed to
change the return value in some place.  It makes perf help print
annoying output even for sane config items like below:

  $ perf help
  '.root': unsupported man viewer sub key.
  ...
Reported-by: NArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
Tested-by: NTaeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Sihyeon Jang <uneedsihyeon@gmail.com>
Cc: kernel-team@lge.com
Link: http://lkml.kernel.org/r/20171114001542.GA16464@sejong
Fixes: 8e99b6d4 ("tools include: Adopt strstarts() from the kernel")
Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 4a2233b1
...@@ -284,7 +284,7 @@ static int perf_help_config(const char *var, const char *value, void *cb) ...@@ -284,7 +284,7 @@ static int perf_help_config(const char *var, const char *value, void *cb)
add_man_viewer(value); add_man_viewer(value);
return 0; return 0;
} }
if (!strstarts(var, "man.")) if (strstarts(var, "man."))
return add_man_viewer_info(var, value); return add_man_viewer_info(var, value);
return 0; return 0;
...@@ -314,7 +314,7 @@ static const char *cmd_to_page(const char *perf_cmd) ...@@ -314,7 +314,7 @@ static const char *cmd_to_page(const char *perf_cmd)
if (!perf_cmd) if (!perf_cmd)
return "perf"; return "perf";
else if (!strstarts(perf_cmd, "perf")) else if (strstarts(perf_cmd, "perf"))
return perf_cmd; return perf_cmd;
return asprintf(&s, "perf-%s", perf_cmd) < 0 ? NULL : s; return asprintf(&s, "perf-%s", perf_cmd) < 0 ? NULL : s;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册