This solves the bug, but could someone please explain me why it
doesn't work in the original code?

Old:
   if ( (res = menuBox(prtbuf, _("Where should the LILO boot loader be installed?"), 
opt, 2, 1) == -1 ))
   ...
 The return value of menuBox is not assigned to res.
 It still has the inital value of 0.
 
New:
   res = menuBox(prtbuf, _("Where should the LILO boot loader be installed?"), opt, 2, 
1);
   if ( res == -1 ) ...
 The return value of menuBox is assigned to res.

-- 
ShdW <[EMAIL PROTECTED]>
--- bootconfig.c        Sat Feb  2 00:09:52 2002
+++ bootconfig.new.c    Sat Feb  2 00:28:20 2002
@@ -2360,7 +2360,8 @@
             opt[1].string = _("Install LILO in the root partition's boot sector.");
       snprintf(prtbuf, sizeof(prtbuf), _("LILO can be installed either into the 
master boot record (MBR), or into the %s boot block. If installed into the MBR, LILO 
will take control of the boot process. If you choose not to install LILO into the MBR, 
you will have the opportunity later on to install an alternative MBR program (for 
bootstrapping LILO).\n"),
               Boot->name);
-      if ( (res = menuBox(prtbuf, _("Where should the LILO boot loader be 
installed?"), opt, 2, 1) == -1 ))
+         res = menuBox(prtbuf, _("Where should the LILO boot loader be installed?"), 
+opt, 2, 1);
+      if ( res == -1 )
              return 0;
       
       boot = opt[res].tag;

Reply via email to