Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752872AbdDLFjb (ORCPT ); Wed, 12 Apr 2017 01:39:31 -0400 Received: from terminus.zytor.com ([65.50.211.136]:45199 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750979AbdDLFj3 (ORCPT ); Wed, 12 Apr 2017 01:39:29 -0400 Date: Tue, 11 Apr 2017 22:35:55 -0700 From: tip-bot for Taeung Song Message-ID: Cc: namhyung@kernel.org, tglx@linutronix.de, acme@redhat.com, jolsa@kernel.org, peterz@infradead.org, hpa@zytor.com, linux-kernel@vger.kernel.org, treeze.taeung@gmail.com, wangnan0@huawei.com, mhiramat@kernel.org, mingo@kernel.org Reply-To: mingo@kernel.org, mhiramat@kernel.org, treeze.taeung@gmail.com, wangnan0@huawei.com, linux-kernel@vger.kernel.org, hpa@zytor.com, jolsa@kernel.org, acme@redhat.com, peterz@infradead.org, tglx@linutronix.de, namhyung@kernel.org In-Reply-To: <1491575061-704-4-git-send-email-treeze.taeung@gmail.com> References: <1491575061-704-4-git-send-email-treeze.taeung@gmail.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf ui browser: Refactor the code to parse color configs with ltrim() Git-Commit-ID: e21600fd41106f7a0ca124cec2404b2b3562768d X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1382 Lines: 37 Commit-ID: e21600fd41106f7a0ca124cec2404b2b3562768d Gitweb: http://git.kernel.org/tip/e21600fd41106f7a0ca124cec2404b2b3562768d Author: Taeung Song AuthorDate: Fri, 7 Apr 2017 23:24:19 +0900 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 11 Apr 2017 08:45:10 -0300 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 --- 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;