aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <[email protected]>2019-06-26 00:46:39 +0000
committerArnaldo Carvalho de Melo <[email protected]>2019-06-26 14:31:37 +0000
commitee44b5b51f37727f57962b2cdccd548c62045252 (patch)
treea704fcafeaca01f3ee8c0e7a5055ec2a011a2927
parentperf time-utils: Use skip_spaces() (diff)
downloadkernel-ee44b5b51f37727f57962b2cdccd548c62045252.tar.gz
kernel-ee44b5b51f37727f57962b2cdccd548c62045252.zip
perf probe: Use skip_spaces() for argv handling
The skip_sep() routine has the same implementation as skip_spaces(), recently adopted from the kernel, sources, switch to it. Cc: Adrian Hunter <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Masami Hiramatsu <[email protected]> Cc: Namhyung Kim <[email protected]> Link: https://lkml.kernel.org/n/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-rw-r--r--tools/perf/util/string.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/tools/perf/util/string.c b/tools/perf/util/string.c
index 084c3e4e9400..d28e723e2790 100644
--- a/tools/perf/util/string.c
+++ b/tools/perf/util/string.c
@@ -69,18 +69,6 @@ out_err:
return -1;
}
-/*
- * Helper function for splitting a string into an argv-like array.
- * originally copied from lib/argv_split.c
- */
-static const char *skip_sep(const char *cp)
-{
- while (*cp && isspace(*cp))
- cp++;
-
- return cp;
-}
-
static const char *skip_arg(const char *cp)
{
while (*cp && !isspace(*cp))
@@ -94,7 +82,7 @@ static int count_argc(const char *str)
int count = 0;
while (*str) {
- str = skip_sep(str);
+ str = skip_spaces(str);
if (*str) {
count++;
str = skip_arg(str);
@@ -148,7 +136,7 @@ char **argv_split(const char *str, int *argcp)
argvp = argv;
while (*str) {
- str = skip_sep(str);
+ str = skip_spaces(str);
if (*str) {
const char *p = str;