From: Taeung Song Date: Fri, 7 Apr 2017 14:24:19 +0000 (+0900) Subject: perf ui browser: Refactor the code to parse color configs with ltrim() X-Git-Tag: MMI-PSA29.97-13-9~5737^2~12^2~13 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e21600fd41106f7a0ca124cec2404b2b3562768d;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git perf ui browser: Refactor the code to parse color configs with ltrim() When parsing {fore, back} ground color configs, use ltrim() instead of just while loop and isspace(). Signed-off-by: Taeung Song Cc: Jiri Olsa Cc: Masami Hiramatsu Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Wang Nan Link: http://lkml.kernel.org/r/1491575061-704-4-git-send-email-treeze.taeung@gmail.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/ui/browser.c b/tools/perf/ui/browser.c index 3eb3edb307a4..9e47ccbe07f1 100644 --- a/tools/perf/ui/browser.c +++ b/tools/perf/ui/browser.c @@ -579,7 +579,7 @@ static int ui_browser__color_config(const char *var, const char *value, break; *bg = '\0'; - while (isspace(*++bg)); + bg = ltrim(++bg); ui_browser__colorsets[i].bg = bg; ui_browser__colorsets[i].fg = fg; return 0;