To: linux-m68k@lists.linux-m68k.org
Subject: L68K: Bug in lxdialog
X-Yow: Hello, GORRY-O!!  I'm a GENIUS from HARVARD!!
From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
Date: 15 Dec 1997 11:44:21 +0100
Sender: owner-linux-m68k@phil.uni-sb.de

There is a bug in the lxdialog utility, which tries to write to the lower
right position of a window while scrolling is enabled.  This causes the
window to scroll, and to mess up the whole display.

Andreas.

======================================================================
--- scripts/lxdialog/menubox.c.~1~	Mon Apr 29 19:45:05 1996
+++ scripts/lxdialog/menubox.c	Sun Dec 14 10:47:29 1997
@@ -261,26 +261,26 @@
                     choice = MIN(choice+1, max_choice-1);
 
 	    } else if (key == KEY_PPAGE) {
-	        scrollok (menu, TRUE);
                 for (i=0; (i < max_choice) && (scroll > 0); i++) {
+		    scrollok (menu, TRUE);
                     wscrl (menu, -1);
+		    scrollok (menu, FALSE);
                     scroll--;
                     print_item (menu, items[scroll * 2 + 1], 0, FALSE,
                                (items[scroll*2][0] != ':'));
                 }
-                scrollok (menu, FALSE);
                 choice = 0;
 
             } else if (key == KEY_NPAGE) {
-	        scrollok (menu, TRUE);
                 for (i=0; (i < max_choice) && (scroll+max_choice < item_no); i++) {
+		    scrollok (menu, TRUE);
 		    scroll(menu);
+		    scrollok (menu, FALSE);
                     scroll++;
                     print_item (menu, items[(scroll+max_choice-1)*2+1],
                                 max_choice-1, FALSE,
                                 (items[(scroll+max_choice-1)*2][0] != ':'));
                 }
-                scrollok (menu, FALSE);
                 choice = 0;
 
             } else
