From patchwork Mon May 20 15:48:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 2594021 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 221B4DFB79 for ; Mon, 20 May 2013 15:48:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932071Ab3ETPs0 (ORCPT ); Mon, 20 May 2013 11:48:26 -0400 Received: from mail-we0-f172.google.com ([74.125.82.172]:39218 "EHLO mail-we0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755998Ab3ETPsO (ORCPT ); Mon, 20 May 2013 11:48:14 -0400 Received: by mail-we0-f172.google.com with SMTP id w62so490653wes.17 for ; Mon, 20 May 2013 08:48:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:in-reply-to:references; bh=HtZN33r7lK7cbKpfMW55wP55mSs97AGhGWjpFNCalFU=; b=IefyJhs4whHCl/3eM9/U3WoL9M4aYjaJhW4gh4LmIeG0yciujpIT3XVlvAEov9K8tf 1sikGaj0s5HxSMeGuor7V4Q6EvBvX+nCMR4O2r2PfKGnFJIlMxBximzJ8QQqMe26uO4N c1sA2sO55mW9Zmnx4bUrhoR4Y0T1LidzMmxTnNh3ifZjbXJebg34eo7rkn/nXr+NfbWl ADbW8ZqZrOmX604BXtiQwNg5pA17zG2tzYwD18x/9yi7q/+ekju0XsHIrjhgHvs8SxpO lRS/TFxQlyTKZZisZDSx5u8nl6FrI9NCyrZa/7x/H0q6wbYpyc4bpnfgnRRpv530Hm/t 71Cw== X-Received: by 10.180.36.147 with SMTP id q19mr14475371wij.26.1369064893437; Mon, 20 May 2013 08:48:13 -0700 (PDT) Received: from gourin.bzh.lan (ks3095497.kimsufi.com. [94.23.60.27]) by mx.google.com with ESMTPSA id ed20sm15600510wic.0.2013.05.20.08.48.11 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 20 May 2013 08:48:12 -0700 (PDT) From: "Yann E. MORIN" To: Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Dirk Gouders , "Yann E. MORIN" Subject: [PATCH 2/2] mconf: handle keys in empty dialogs Date: Mon, 20 May 2013 17:48:03 +0200 Message-Id: <8f9c6f75f603132869375a203d22e5b445f6294f.1369064712.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: References: In-Reply-To: References: Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org From: Dirk Gouders When entering an empty dialog, using the movement keys resulted in unexpected characters beeing displayed, other keys like "z" and "h" did not work as expected. This patch handles the movement keys as well as other keys, especially "z", "h" and "/". Signed-off-by: Dirk Gouders Tested-by: "Yann E. MORIN" Reviewed-by: "Yann E. MORIN" Signed-off-by: "Yann E. MORIN" --- scripts/kconfig/lxdialog/menubox.c | 8 ++++---- scripts/kconfig/mconf.c | 11 ++++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/scripts/kconfig/lxdialog/menubox.c b/scripts/kconfig/lxdialog/menubox.c index 48d382e..eda0350 100644 --- a/scripts/kconfig/lxdialog/menubox.c +++ b/scripts/kconfig/lxdialog/menubox.c @@ -303,10 +303,10 @@ do_resize: } } - if (i < max_choice || - key == KEY_UP || key == KEY_DOWN || - key == '-' || key == '+' || - key == KEY_PPAGE || key == KEY_NPAGE) { + if ((i < max_choice || + key == KEY_UP || key == KEY_DOWN || + key == '-' || key == '+' || + key == KEY_PPAGE || key == KEY_NPAGE) && item_count() != 0) { /* Remove highligt of current item */ print_item(scroll + choice, choice, FALSE); diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index 387dc8d..a69cbd7 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c @@ -670,11 +670,12 @@ static void conf(struct menu *menu, struct menu *active_menu) active_menu, &s_scroll); if (res == 1 || res == KEY_ESC || res == -ERRDISPLAYTOOSMALL) break; - if (!item_activate_selected()) - continue; - if (!item_tag()) - continue; - + if (item_count() != 0) { + if (!item_activate_selected()) + continue; + if (!item_tag()) + continue; + } submenu = item_data(); active_menu = item_data(); if (submenu)