From patchwork Fri Oct 19 23:06:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 1620331 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 537723FC1A for ; Fri, 19 Oct 2012 23:07:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932965Ab2JSXHo (ORCPT ); Fri, 19 Oct 2012 19:07:44 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:48240 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755684Ab2JSXGh (ORCPT ); Fri, 19 Oct 2012 19:06:37 -0400 Received: by mail-wg0-f44.google.com with SMTP id dr13so727856wgb.1 for ; Fri, 19 Oct 2012 16:06:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=ui5hiRAcjDIa4N4AEsitrYQ//UfnTB+/corm23oXZIM=; b=FfP9RRDdzPZgoidqmn/pKnDa8cJjp8FC5kGMjG1tWfr0J8sj78IpB4OtwmwaJ87bow OGyslfNqiZaeX/nyj5Q1aAJnEqPd2qW1NJcifIT89V/YbxKbSTeWmBZePsQuXIGlaP7q tkQy95iDv55AFEPxvMaVKEf9ZJkIAgQ03y7fDXBWI0BwqeS9ylISjqhPtuQUzabeetEP 5oog1NRvrDSbI71YIDYha5P0IzQCvQhiik2JjEZMJuAbrJFfXmcCZIaeJfSBoX8KygFx 3OlBpScXQhcwxsFZJRZI0GlPhPHw9T9HNizeI7RNFMNZzHpOfNqQJqnuWF4Q623ksGO2 tyVw== Received: by 10.180.87.42 with SMTP id u10mr6152682wiz.0.1350687996249; Fri, 19 Oct 2012 16:06:36 -0700 (PDT) Received: from localhost.localdomain (ARennes-256-1-43-34.w90-32.abo.wanadoo.fr. [90.32.26.34]) by mx.google.com with ESMTPS id fp6sm17125857wib.0.2012.10.19.16.06.35 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 19 Oct 2012 16:06:35 -0700 (PDT) From: "Yann E. MORIN" To: linux-kbuild@vger.kernel.org Cc: Michal Marek , linux-kernel@vger.kernel.org, "Yann E. MORIN" Subject: [PATCH 1/3] kconfig: remove CONFIG_ from string constants Date: Sat, 20 Oct 2012 01:06:23 +0200 Message-Id: <1350687985-21053-2-git-send-email-yann.morin.1998@free.fr> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1350687985-21053-1-git-send-email-yann.morin.1998@free.fr> References: <1350687985-21053-1-git-send-email-yann.morin.1998@free.fr> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org Having the CONFIG_ prefix in string constants gets in the way of using a run-time-defined CONFIG_ prefix. Fix that by using temp growable strings (gstr) in which we printf the text. Signed-off-by: "Yann E. MORIN" --- scripts/kconfig/mconf.c | 10 ++++++++-- scripts/kconfig/nconf.c | 11 +++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index 48f6744..5f29618 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c @@ -348,15 +348,19 @@ static void search_conf(void) { struct symbol **sym_arr; struct gstr res; + struct gstr title; char *dialog_input; int dres, vscroll = 0, hscroll = 0; bool again; + title = str_new(); + str_printf( &title, _("Enter %s (sub)string to search for " + "(with or without \"%s\")"), CONFIG_, CONFIG_); + again: dialog_clear(); dres = dialog_inputbox(_("Search Configuration Parameter"), - _("Enter " CONFIG_ " (sub)string to search for " - "(with or without \"" CONFIG_ "\")"), + str_get(&title), 10, 75, ""); switch (dres) { case 0: @@ -365,6 +369,7 @@ again: show_helptext(_("Search Configuration"), search_help); goto again; default: + str_free(&title); return; } @@ -398,6 +403,7 @@ again: str_free(&res); } while (again); free(sym_arr); + str_free(&title); } static void build_conf(struct menu *menu) diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c index 87d4b15..261f926 100644 --- a/scripts/kconfig/nconf.c +++ b/scripts/kconfig/nconf.c @@ -696,13 +696,18 @@ static void search_conf(void) { struct symbol **sym_arr; struct gstr res; + struct gstr title; char *dialog_input; int dres; + + title = str_new(); + str_printf( &title, _("Enter %s (sub)string to search for " + "(with or without \"%s\")"), CONFIG_, CONFIG_); + again: dres = dialog_inputbox(main_window, _("Search Configuration Parameter"), - _("Enter " CONFIG_ " (sub)string to search for " - "(with or without \"" CONFIG_ "\")"), + str_get(&title), "", &dialog_input_result, &dialog_input_result_len); switch (dres) { case 0: @@ -712,6 +717,7 @@ again: _("Search Configuration"), search_help); goto again; default: + str_free(&title); return; } @@ -726,6 +732,7 @@ again: show_scroll_win(main_window, _("Search Results"), str_get(&res)); str_free(&res); + str_free(&title); }