Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933901AbdDGOZH (ORCPT ); Fri, 7 Apr 2017 10:25:07 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:36053 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933712AbdDGOYh (ORCPT ); Fri, 7 Apr 2017 10:24:37 -0400 From: Taeung Song To: Arnaldo Carvalho de Melo Cc: linux-kernel@vger.kernel.org, Jiri Olsa , Namhyung Kim , Ingo Molnar , Peter Zijlstra , Wang Nan , Masami Hiramatsu , Taeung Song Subject: [PATCH 3/5] perf ui browser: Refactor the code to parse color configs with ltrim() Date: Fri, 7 Apr 2017 23:24:19 +0900 Message-Id: <1491575061-704-4-git-send-email-treeze.taeung@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1491575061-704-1-git-send-email-treeze.taeung@gmail.com> References: <1491575061-704-1-git-send-email-treeze.taeung@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 730 Lines: 25 When parsing {fore, back} ground color configs, use ltrim() instead of just while loop and isspace(). Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Taeung Song --- tools/perf/ui/browser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/ui/browser.c b/tools/perf/ui/browser.c index 3eb3edb..9e47ccb 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; -- 2.7.4