lkml.org 
[lkml]   [1998]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateTue, 7 Jul 1998 23:15:03 +0200 (MEST)
FromClifford Wolf <>
SubjectRe: make menuconfig error

On Mon, 6 Jul 1998, Spirilis wrote:

> An error occurred while about ready to compile 2.1.108ac2 + devfs-44
>
> There seems to be a problem with the lxdialog companion utility which is
> built prior to running Menuconfig. Usually this is an indicator that you
> have upgraded/downgraded your ncurses libraries and did not remove the
> old ncurses header file(s) in /usr/include or /usr/include/ncurses.
>
> It is VERY important that you have only one set of ncurses header files
> and that those files are properly version matched to the ncurses libraries
> installed on your machine.
>
> You may also need to rebuild lxdialog. This can be done by moving to
> the /usr/src/linux/scripts/lxdialog directory and issuing the
> "make clean all" command.
>
> If you have verified that your ncurses install is correct, you may email
> the maintainer <mec@shout.net> or post a message to
> <linux-kernel@vger.rutgers.edu> for additional assistance.
>
> make: *** [menuconfig] Error 139

Thats a bug in the second version of my lxdialog-patch. I sent allready a
third version of the patch to this list weeks ago and I really wonder why
the older version is included (I wonder too why there is no comment with
my name in it :-).

Alan, Michael: I attached the third version of my patch with this mail
again (the patch is made for 2.1.106 but should work with 2.1.108).
Please include it becouse it fixes this bug.

- clifford

-- -- -- -- -- -- -- -- -- -- -- -- --
Clifford Wolf
magnet - Internet at Work IRC: efnet / clifford
Director of System Development http://www.clifford.at/
e-mail: c.wolf@magnet.at email: god@clifford.at
--- linux/scripts/lxdialog/menubox.c.orig Sat Apr 27 12:18:18 1996
+++ linux/scripts/lxdialog/menubox.c Sun Jun 14 09:32:29 1998
@@ -19,6 +19,37 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

+/*
+ * Changes by Clifford Wolf (god@clifford.at)
+ *
+ * [ 1998-06-13 ]
+ *
+ * *) A bugfix for the Page-Down problem
+ *
+ * *) If i use Page-Down and Page-Up normaly the cursor would be just
+ * set to the first position in the menu box - now lxdialog is a bit
+ * smarter and works more like one is it used from most other menu
+ * systems (just have a look at it).
+ *
+ * *) Normaly if i select something my scrolling will be broken becouse
+ * lxdialog is re-invoked by the Menuconfig shellscript and can't
+ * remember the last scrolling-position and just sets it so that the
+ * cursor is at the bottom of the box. Now it writes a tempfile called
+ * "lxdialog.scrltmp" which contains this information. The tempfile is
+ * deleted by lxdialog if the users leaves a submenu or enters a new
+ * one - but it would be nice if Menuconfig could make another "rm -f"
+ * just to be sure. Just try it out - you will recognise a difference!
+ *
+ * [ 1998-06-14 ]
+ *
+ * *) lxdialog is now crash save against broken "lxdialog.scrltmp" files
+ * and menus they change their size on the fly.
+ *
+ * *) If the last scrolling position is not saved by lxdialog for some
+ * reason it sets the scrolling so that the selected item is in the
+ * middle of the menubox (and not at the bottom).
+ */
+
#include "dialog.h"

static int menu_width, item_x;
@@ -123,6 +154,7 @@
int i, j, x, y, box_x, box_y;
int key = 0, button = 0, scroll = 0, choice = 0, first_item = 0, max_choice;
WINDOW *dialog, *menu;
+ FILE *f;

max_choice = MIN (menu_height, item_no);

@@ -178,9 +210,26 @@

item_x = (menu_width - item_x) / 2;

- if (choice >= max_choice){
- scroll = first_item = choice - max_choice + 1;
- choice = max_choice-1;
+ /* get the scroll info from the temp file */
+ if ( (f=fopen("lxdialog.scrltmp","r")) != NULL ) {
+ if ( (fscanf(f,"%d\n",&scroll) == 1) && (scroll <= choice) &&
+ (scroll+max_choice > choice) && (scroll >= 0) &&
+ (scroll+max_choice <= item_no) ) {
+ first_item = scroll;
+ choice = choice - scroll;
+ fclose(f);
+ } else {
+ remove("lxdialog.scrltmp");
+ fclose(f);
+ f=NULL;
+ }
+ }
+ if ( (choice >= max_choice) || (f==NULL && choice >= max_choice/2) ) {
+ if (choice >= item_no-max_choice/2)
+ scroll = first_item = item_no-max_choice;
+ else
+ scroll = first_item = choice - max_choice/2;
+ choice = choice - scroll;
}

/* Print the menu */
@@ -262,26 +311,34 @@

} else if (key == KEY_PPAGE) {
scrollok (menu, TRUE);
- for (i=0; (i < max_choice) && (scroll > 0); i++) {
- wscrl (menu, -1);
- scroll--;
- print_item (menu, items[scroll * 2 + 1], 0, FALSE,
- (items[scroll*2][0] != ':'));
+ for (i=0; (i < max_choice); i++) {
+ if (scroll > 0) {
+ wscrl (menu, -1);
+ scroll--;
+ print_item (menu, items[scroll * 2 + 1], 0, FALSE,
+ (items[scroll*2][0] != ':'));
+ } else {
+ if (choice > 0)
+ choice--;
+ }
}
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++) {
- scroll(menu);
- scroll++;
- print_item (menu, items[(scroll+max_choice-1)*2+1],
- max_choice-1, FALSE,
- (items[(scroll+max_choice-1)*2][0] != ':'));
+ for (i=0; (i < max_choice); i++) {
+ if (scroll+max_choice < item_no) {
+ 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] != ':'));
+ } else {
+ if (choice+1 < max_choice)
+ choice++;
+ }
}
- scrollok (menu, FALSE);
- choice = 0;

} else
choice = i;
@@ -313,6 +370,11 @@
case 'y':
case 'n':
case 'm':
+ /* save scroll info */
+ if ( (f=fopen("lxdialog.scrltmp","w")) != NULL ) {
+ fprintf(f,"%d\n",scroll);
+ fclose(f);
+ }
delwin (dialog);
fprintf(stderr, "%s\n", items[(scroll + choice) * 2]);
switch (key) {
@@ -336,6 +398,7 @@
else
fprintf(stderr, "%s\n", items[(scroll + choice) * 2]);

+ remove("lxdialog.scrltmp");
return button;
case 'e':
case 'x':
@@ -346,5 +409,6 @@
}

delwin (dialog);
+ remove("lxdialog.scrltmp");
return -1; /* ESC pressed */
}
\
 
 \ /
  Last update: 2005-03-22 13:43    [from the cache]
©2003-2010