simple menu: make "menu default" work after "menu begin"
authorH. Peter Anvin <hpa@zytor.com>
Mon, 22 Sep 2008 18:07:22 +0000 (11:07 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Mon, 22 Sep 2008 18:08:35 +0000 (11:08 -0700)
Make "menu default" work after "menu begin", similar to after
"label".  This is consistent with how "menu label" works.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
com32/menu/readconfig.c

index e26105a..0d3093b 100644 (file)
@@ -624,7 +624,11 @@ static void parse_config_file(FILE *f)
          }
        }
       } else if ( looking_at(p, "default") ) {
-       ld.menudefault = 1;
+       if (ld.label) {
+         ld.menudefault = 1;
+       } else if (m->parent_entry) {
+         m->parent->defentry = m->parent_entry->entry;
+       }
       } else if ( looking_at(p, "hide") ) {
        ld.menuhide = 1;
       } else if ( looking_at(p, "passwd") ) {