From patchwork Fri May 17 08:48:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dirk Gouders X-Patchwork-Id: 2581541 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 6DFCEDF215 for ; Fri, 17 May 2013 08:49:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753399Ab3EQItR (ORCPT ); Fri, 17 May 2013 04:49:17 -0400 Received: from mx10.gouders.net ([89.244.147.155]:55411 "EHLO mx10.gouders.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754135Ab3EQItQ (ORCPT ); Fri, 17 May 2013 04:49:16 -0400 Received: from mx10.gouders.net (localhost [127.0.0.1]) by mx10.gouders.net (8.14.6/8.14.5) with ESMTP id r4H8nDcf019485; Fri, 17 May 2013 10:49:13 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gouders.net; s=gnet; t=1368780553; bh=31CnXTSlkHjQEDuajru9P/qK83xBsS+ZYtvjkOJmObU=; h=From:To:Cc:Subject:Date; b=Bv6PiSuvVRT1V91fLzYlJtquk3J4lXtKrRW96HF+Zk25fKyvptuIBx3jceNGbb8YY pwM2uVXDMWYwP8J+SKS0nqoD19piH74n93sezQ2bFsrWnxoZH3kARD26XtGYtN0+/o ojxJTCRGTYhcpVRogifst98HpG+s79ukX8Z59+vc= From: Dirk Gouders To: "Yann E. MORIN" Cc: linux-kbuild@vger.kernel.org Subject: [PATCH] mconf: handle keys in empty dialogs Date: Fri, 17 May 2013 10:48:43 +0200 Message-Id: <1368780523-19382-2-git-send-email-dirk@gouders.net> X-Mailer: git-send-email 1.8.2.1 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org 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 --- 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..f5aff9c 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()) { /* 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..ccb71ae 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()) { + if (!item_activate_selected()) + continue; + if (!item_tag()) + continue; + } submenu = item_data(); active_menu = item_data(); if (submenu)