From patchwork Sun May 19 19:48:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dirk Gouders X-Patchwork-Id: 2590371 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 52892DF24C for ; Sun, 19 May 2013 19:48:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753645Ab3ESTst (ORCPT ); Sun, 19 May 2013 15:48:49 -0400 Received: from mx10.gouders.net ([89.244.147.155]:59668 "EHLO mx10.gouders.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753289Ab3ESTss (ORCPT ); Sun, 19 May 2013 15:48:48 -0400 Received: from mx10.gouders.net (localhost [127.0.0.1]) by mx10.gouders.net (8.14.6/8.14.5) with ESMTP id r4JJmi22004737; Sun, 19 May 2013 21:48:44 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gouders.net; s=gnet; t=1368992924; bh=5zEJdoz6UGwIqJY3Vw48zWPwZ1sKrsKgsr9pkqd+N1k=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Yx6jIMNLhMww+UnfYnXxS4REyMt6aI9I0M1A6lG7p0jyd8MLKl/TJI0vDr4xc74i0 dyIIbewJL/BA27v74rAsG/ZKYPpUfohp1MxVwbtiVEsltFoOWXxr5Whue76JSZ1OTA fsxnz2tz9QYlqv+ZGqgqpycqgcMy7MM/5+h3H4a8= From: Dirk Gouders To: "Yann E. MORIN" Cc: linux-kbuild@vger.kernel.org Subject: [PATCH v2] mconf: handle keys in empty dialogs Date: Sun, 19 May 2013 21:48:44 +0200 Message-Id: <1368992924-4700-1-git-send-email-dirk@gouders.net> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <20130519151227.GA3339@free.fr> References: <20130519151227.GA3339@free.fr> 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..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)