From patchwork Thu Aug 4 01:52:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Lacombe X-Patchwork-Id: 1033732 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p741qKdo030628 for ; Thu, 4 Aug 2011 01:52:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756302Ab1HDBwU (ORCPT ); Wed, 3 Aug 2011 21:52:20 -0400 Received: from mail-gx0-f174.google.com ([209.85.161.174]:55657 "EHLO mail-gx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755944Ab1HDBwT (ORCPT ); Wed, 3 Aug 2011 21:52:19 -0400 Received: by gxk21 with SMTP id 21so812111gxk.19 for ; Wed, 03 Aug 2011 18:52:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=EKyeLW46ObzziIRRQ0hD8Bm/QlWn+Sz+MvMxhkoYI6o=; b=bD2p2h/7V5D9oYfCwtYe7YYqZsjapmHHpJ0ibq9PN9mbQzAFcVpl8CHyamtfmFsjYL 5Rp1Dh9MPt4zvMASyEpGi/iZxHBAlF5SW/lKx8sNgn9D/NQAsp13p5rV3CfyaDaqubWF S42FA8+Cs/EbMW4nGX/yA3d4894chW40WOqpE= Received: by 10.42.94.145 with SMTP id b17mr172334icn.443.1312422738685; Wed, 03 Aug 2011 18:52:18 -0700 (PDT) Received: from localhost.localdomain (69-165-143-95.dsl.teksavvy.com [69.165.143.95]) by mx.google.com with ESMTPS id t7sm929728ibt.37.2011.08.03.18.52.17 (version=SSLv3 cipher=OTHER); Wed, 03 Aug 2011 18:52:17 -0700 (PDT) From: Arnaud Lacombe To: Michal Marek Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, Arnaud Lacombe , Srinivas Kandagatla Subject: [PATCH 2/2] kconfig: factor code in menu_get_ext_help() Date: Wed, 3 Aug 2011 21:52:07 -0400 Message-Id: <1312422727-9740-2-git-send-email-lacombar@gmail.com> X-Mailer: git-send-email 1.7.6.153.g78432 In-Reply-To: <1312422727-9740-1-git-send-email-lacombar@gmail.com> References: <1312422727-9740-1-git-send-email-lacombar@gmail.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 04 Aug 2011 01:52:21 +0000 (UTC) Cc: Srinivas Kandagatla Signed-off-by: Arnaud Lacombe --- scripts/kconfig/menu.c | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index beeb92e..8c2a97e 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -10,8 +10,7 @@ #include "lkc.h" -static const char nohelp_text[] = N_( - "There is no help available for this option.\n"); +static const char nohelp_text[] = "There is no help available for this option."; struct menu rootmenu; static struct menu **last_entry_ptr; @@ -595,15 +594,14 @@ struct gstr get_relations_str(struct symbol **sym_arr) void menu_get_ext_help(struct menu *menu, struct gstr *help) { struct symbol *sym = menu->sym; + const char *help_text = nohelp_text; if (menu_has_help(menu)) { if (sym->name) str_printf(help, "%s%s:\n\n", CONFIG_, sym->name); - str_append(help, _(menu_get_help(menu))); - str_append(help, "\n"); - } else { - str_append(help, nohelp_text); + help_text = menu_get_help(menu); } + str_printf(help, "%s\n", _(help_text)); if (sym) get_symbol_str(help, sym); }