lxdialog: checklist.c patch

Alexander V. Lukyanov (lav@alpha.netis.ru)
Fri, 20 Feb 1998 21:11:19 +0300


The following patch fixes a bug in checklist.c. The bug can be seen
when a long list is passed to lxdialog and current item is below
the window height. This is so in Alpha system type choice.

--- checklist.c.old Fri Feb 20 20:54:34 1998
+++ checklist.c Fri Feb 20 21:05:48 1998
@@ -188,9 +188,16 @@
check_x = (list_width - check_x) / 2;
item_x = check_x + 4;

+ if (choice >= list_height) {
+ scroll = choice - list_height + 1;
+ choice -= scroll;
+ }
+
/* Print the list */
- for (i = 0; i < max_choice; i++)
- print_item (list, items[i * 3 + 1], status[i], i, i == choice);
+ for (i = 0; i < max_choice; i++) {
+ print_item (list, items[(scroll+i) * 3 + 1],
+ status[i+scroll], i, i == choice);
+ }

wnoutrefresh (list);

Alexander.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu