perf ui browser: Refactor the code to parse color configs with ltrim()
authorTaeung Song <treeze.taeung@gmail.com>
Fri, 7 Apr 2017 14:24:19 +0000 (23:24 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 11 Apr 2017 11:45:10 +0000 (08:45 -0300)
When parsing {fore, back} ground color configs, use ltrim() instead of
just while loop and isspace().

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1491575061-704-4-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/ui/browser.c

index 3eb3edb307a4814d1d11346f94117d3c006e87b7..9e47ccbe07f16acfb23ea301b7a510bc09b66dcd 100644 (file)
@@ -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;