From 328584804edc950fb4608c9a38e396ac71ef22b6 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Wed, 26 Jun 2019 11:42:03 -0300 Subject: perf tools: Ditch rtrim(), use skip_spaces() to get closer to the kernel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No change in behaviour, just using the same kernel idiom for such operation. Cc: Adrian Hunter Cc: André Goddard Rosa Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lkml.kernel.org/n/tip-a85lkptkt0ru40irpga8yf54@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/string2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/perf/util/string2.h') diff --git a/tools/perf/util/string2.h b/tools/perf/util/string2.h index 07fd37568543..db02059e31c5 100644 --- a/tools/perf/util/string2.h +++ b/tools/perf/util/string2.h @@ -2,6 +2,7 @@ #ifndef PERF_STRING_H #define PERF_STRING_H +#include #include #include #include @@ -22,12 +23,11 @@ static inline bool strisglob(const char *str) int strtailcmp(const char *s1, const char *s2); char *strxfrchar(char *s, char from, char to); -char *ltrim(char *s); char *rtrim(char *s); static inline char *trim(char *s) { - return ltrim(rtrim(s)); + return skip_spaces(rtrim(s)); } char *asprintf_expr_inout_ints(const char *var, bool in, size_t nints, int *ints); -- cgit v1.2.3-59-g8ed1b