From owner-freebsd-bugs@FreeBSD.ORG Tue Aug 11 11:50:07 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19BA51065670 for ; Tue, 11 Aug 2009 11:50:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 610AE8FC6D for ; Tue, 11 Aug 2009 11:50:06 +0000 (UTC) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n7BBo6sY021899 for ; Tue, 11 Aug 2009 11:50:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n7BBo6mp021897; Tue, 11 Aug 2009 11:50:06 GMT (envelope-from gnats) Resent-Date: Tue, 11 Aug 2009 11:50:06 GMT Resent-Message-Id: <200908111150.n7BBo6mp021897@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Stefan Bethke Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 344AE1065673 for ; Tue, 11 Aug 2009 11:48:53 +0000 (UTC) (envelope-from stb@diesel.lassitu.de) Received: from koef.zs64.net (koef.zs64.net [212.12.50.230]) by mx1.freebsd.org (Postfix) with ESMTP id 96D408FC6F for ; Tue, 11 Aug 2009 11:48:52 +0000 (UTC) Received: from koef.zs64.net (koef.zs64.net [212.12.50.230]) by koef.zs64.net (8.14.3/8.14.3) with ESMTP id n7BBRU01031517 for ; Tue, 11 Aug 2009 13:27:30 +0200 (CEST) (envelope-from stb@diesel.lassitu.de) Received: (from root@localhost) by koef.zs64.net (8.14.3/8.14.3/Submit) id n7BBRUqk031516 for FreeBSD-gnats-submit@freebsd.org; Tue, 11 Aug 2009 13:27:30 +0200 (CEST) (envelope-from stb@diesel.lassitu.de) Message-Id: <200908111127.n7BBRUqk031516@koef.zs64.net> Date: Tue, 11 Aug 2009 13:27:30 +0200 (CEST) From: Stefan Bethke To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: gnu/137665: [patch] dialog goes into tight loop on encountering eof X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Stefan Bethke List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Aug 2009 11:50:07 -0000 >Number: 137665 >Category: gnu >Synopsis: [patch] dialog goes into tight loop on encountering eof >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Aug 11 11:50:05 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Stefan Bethke >Release: FreeBSD 8.0-BETA2 amd64 >Organization: >Environment: System: FreeBSD diesel.lassitu.de 8.0-BETA2 FreeBSD 8.0-BETA2 #8 r195941: Wed Jul 29 15:55:32 CEST 2009 root@diesel.lassitu.de:/usr/obj/usr/src/sys/DIESEL amd64 >Description: >How-To-Repeat: dialog --yesno foo -1 -1 Fix: This patch checks for wgetch() return value of ERR, and takes the same action as the user pressing escape. Index: msgbox.c =================================================================== --- msgbox.c (revision 195941) +++ msgbox.c (working copy) @@ -97,7 +97,7 @@ display_helpline(dialog, height-1, width); print_button(dialog, " OK ", height-2, width/2-6, TRUE); wrefresh(dialog); - while (key != ESC && key != '\n' && key != ' ' && key != '\r') + while (key != ERR && key != ESC && key != '\n' && key != ' ' && key != '\r') key = wgetch(dialog); if (key == '\r') key = '\n'; Index: inputbox.c =================================================================== --- inputbox.c (revision 195941) +++ inputbox.c (working copy) @@ -181,6 +181,9 @@ case '?': display_helpfile(); break; + case ERR: + key = ESC; + break; } } Index: checklist.c =================================================================== --- checklist.c (revision 195941) +++ checklist.c (working copy) @@ -202,6 +202,11 @@ while (key != ESC) { key = wgetch(dialog); + if (key == ERR) { + key = ESC; + break; + } + /* Shortcut to OK? */ if (toupper(key) == okButton) { if (ditems) { Index: ui_objects.c =================================================================== --- ui_objects.c (revision 195941) +++ ui_objects.c (working copy) @@ -666,7 +666,7 @@ if (!quit) key = wgetch(lo->win); } - if (key == ESC) { + if (key == ESC || key == ERR) { return(SEL_ESC); } if (key == '\t') { Index: lineedit.c =================================================================== --- lineedit.c (revision 195941) +++ lineedit.c (working copy) @@ -66,6 +66,7 @@ case KEY_F(1): display_helpfile(); break; + case ERR: case TAB: case KEY_BTAB: case KEY_UP: Index: textbox.c =================================================================== --- textbox.c (revision 195941) +++ textbox.c (working copy) @@ -411,6 +411,7 @@ else /* no need to find */ fprintf(stderr, "\a"); /* beep */ break; + case ERR: case ESC: break; case KEY_F(1): Index: yesno.c =================================================================== --- yesno.c (revision 195941) +++ yesno.c (working copy) @@ -159,6 +159,9 @@ case '?': display_helpfile(); break; + case ERR: + key = ESC; + break; } } Index: tree.c =================================================================== --- tree.c (revision 195941) +++ tree.c (working copy) @@ -446,6 +446,7 @@ if (!button) *result = scroll+choice; return button; + case ERR: case ESC: break; case KEY_F(1): Index: prgbox.c =================================================================== --- prgbox.c (revision 195941) +++ prgbox.c (working copy) @@ -136,7 +136,7 @@ display_helpline(dialog, height-1, width); print_button(dialog, " OK ", height-2, width/2-6, TRUE); wrefresh(dialog); - while (key != ESC && key != '\n' && key != ' ' && key != '\r') + while (key != ERR && key != ESC && key != '\n' && key != ' ' && key != '\r') key = wgetch(dialog); if (key == '\r') key = '\n'; Index: menubox.c =================================================================== --- menubox.c (revision 195941) +++ menubox.c (working copy) @@ -187,6 +187,11 @@ while (key != ESC) { key = wgetch(dialog); + if (key == ERR) { + key = ESC; + break; + } + /* Shortcut to OK? */ if (toupper(key) == okButton) { if (ditems) { Index: radiolist.c =================================================================== --- radiolist.c (revision 195941) +++ radiolist.c (working copy) @@ -544,7 +544,8 @@ key = ESC; break; } - + + case ERR: case ESC: rval = -1; break; >Release-Note: >Audit-Trail: >Unformatted: