|
@@ -89,7 +89,7 @@ struct pager_config {
|
|
static int pager_command_config(const char *var, const char *value, void *data)
|
|
static int pager_command_config(const char *var, const char *value, void *data)
|
|
{
|
|
{
|
|
struct pager_config *c = data;
|
|
struct pager_config *c = data;
|
|
- if (!prefixcmp(var, "pager.") && !strcmp(var + 6, c->cmd))
|
|
|
|
|
|
+ if (strstarts(var, "pager.") && !strcmp(var + 6, c->cmd))
|
|
c->val = perf_config_bool(var, value);
|
|
c->val = perf_config_bool(var, value);
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
@@ -108,9 +108,9 @@ static int check_pager_config(const char *cmd)
|
|
static int browser_command_config(const char *var, const char *value, void *data)
|
|
static int browser_command_config(const char *var, const char *value, void *data)
|
|
{
|
|
{
|
|
struct pager_config *c = data;
|
|
struct pager_config *c = data;
|
|
- if (!prefixcmp(var, "tui.") && !strcmp(var + 4, c->cmd))
|
|
|
|
|
|
+ if (strstarts(var, "tui.") && !strcmp(var + 4, c->cmd))
|
|
c->val = perf_config_bool(var, value);
|
|
c->val = perf_config_bool(var, value);
|
|
- if (!prefixcmp(var, "gtk.") && !strcmp(var + 4, c->cmd))
|
|
|
|
|
|
+ if (strstarts(var, "gtk.") && !strcmp(var + 4, c->cmd))
|
|
c->val = perf_config_bool(var, value) ? 2 : 0;
|
|
c->val = perf_config_bool(var, value) ? 2 : 0;
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
@@ -192,7 +192,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
|
|
/*
|
|
/*
|
|
* Check remaining flags.
|
|
* Check remaining flags.
|
|
*/
|
|
*/
|
|
- if (!prefixcmp(cmd, CMD_EXEC_PATH)) {
|
|
|
|
|
|
+ if (strstarts(cmd, CMD_EXEC_PATH)) {
|
|
cmd += strlen(CMD_EXEC_PATH);
|
|
cmd += strlen(CMD_EXEC_PATH);
|
|
if (*cmd == '=')
|
|
if (*cmd == '=')
|
|
set_argv_exec_path(cmd + 1);
|
|
set_argv_exec_path(cmd + 1);
|
|
@@ -229,7 +229,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
|
|
*envchanged = 1;
|
|
*envchanged = 1;
|
|
(*argv)++;
|
|
(*argv)++;
|
|
(*argc)--;
|
|
(*argc)--;
|
|
- } else if (!prefixcmp(cmd, CMD_DEBUGFS_DIR)) {
|
|
|
|
|
|
+ } else if (strstarts(cmd, CMD_DEBUGFS_DIR)) {
|
|
tracing_path_set(cmd + strlen(CMD_DEBUGFS_DIR));
|
|
tracing_path_set(cmd + strlen(CMD_DEBUGFS_DIR));
|
|
fprintf(stderr, "dir: %s\n", tracing_path);
|
|
fprintf(stderr, "dir: %s\n", tracing_path);
|
|
if (envchanged)
|
|
if (envchanged)
|
|
@@ -470,14 +470,14 @@ int main(int argc, const char **argv)
|
|
* So we just directly call the internal command handler, and
|
|
* So we just directly call the internal command handler, and
|
|
* die if that one cannot handle it.
|
|
* die if that one cannot handle it.
|
|
*/
|
|
*/
|
|
- if (!prefixcmp(cmd, "perf-")) {
|
|
|
|
|
|
+ if (strstarts(cmd, "perf-")) {
|
|
cmd += 5;
|
|
cmd += 5;
|
|
argv[0] = cmd;
|
|
argv[0] = cmd;
|
|
handle_internal_command(argc, argv);
|
|
handle_internal_command(argc, argv);
|
|
fprintf(stderr, "cannot handle %s internally", cmd);
|
|
fprintf(stderr, "cannot handle %s internally", cmd);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
- if (!prefixcmp(cmd, "trace")) {
|
|
|
|
|
|
+ if (strstarts(cmd, "trace")) {
|
|
#ifdef HAVE_LIBAUDIT_SUPPORT
|
|
#ifdef HAVE_LIBAUDIT_SUPPORT
|
|
setup_path();
|
|
setup_path();
|
|
argv[0] = "trace";
|
|
argv[0] = "trace";
|
|
@@ -495,7 +495,7 @@ int main(int argc, const char **argv)
|
|
commit_pager_choice();
|
|
commit_pager_choice();
|
|
|
|
|
|
if (argc > 0) {
|
|
if (argc > 0) {
|
|
- if (!prefixcmp(argv[0], "--"))
|
|
|
|
|
|
+ if (strstarts(argv[0], "--"))
|
|
argv[0] += 2;
|
|
argv[0] += 2;
|
|
} else {
|
|
} else {
|
|
/* The user didn't specify a command; give them help */
|
|
/* The user didn't specify a command; give them help */
|