[syslinux:master] menu: Add MENU GOTO support to the MENU DEFAULT parsing code

syslinux-bot for Matt Fleming matt.fleming at intel.com
Mon Oct 22 12:51:15 PDT 2012


Commit-ID:  b0d5575ded49de084d1abdef3ab66b4c05d9bca9
Gitweb:     http://www.syslinux.org/commit/b0d5575ded49de084d1abdef3ab66b4c05d9bca9
Author:     Matt Fleming <matt.fleming at intel.com>
AuthorDate: Tue, 9 Oct 2012 13:45:00 +0100
Committer:  Matt Fleming <matt.fleming at intel.com>
CommitDate: Tue, 9 Oct 2012 14:06:19 +0100

menu: Add MENU GOTO support to the MENU DEFAULT parsing code

Tomas reported that the 'test1' submenu in the following config file
snippet doesn't honour the MENU DEFAULT directive,

    MENU BEGIN test0
       MENU START
       LABEL -
       MENU DEFAULT
       MENU LABEL OptionA
       MENU GOTO test1
    MENU END

    MENU BEGIN test1
       LABEL -
       MENU LABEL OptionA1
       MENU GOTO test0
       LABEL -
       MENU DEFAULT
       MENU LABEL OptionB1
       MENU GOTO test0
    MENU END

The reason is that the menu config code doesn't know how to handle a
default item that is a MENU GOTO directive. A trivial addition to the
code in record() fixes this.

Reported-by: Tomas M <tomas at slax.org>
Signed-off-by: Matt Fleming <matt.fleming at intel.com>

---
 com32/menu/readconfig.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/com32/menu/readconfig.c b/com32/menu/readconfig.c
index 0ac2564..431017f 100644
--- a/com32/menu/readconfig.c
+++ b/com32/menu/readconfig.c
@@ -392,7 +392,9 @@ static void record(struct menu *m, struct labeldata *ld, const char *append)
 	    break;
 	}
 
-	if (ld->menudefault && me->action == MA_CMD)
+	if (ld->menudefault && (me->action == MA_CMD ||
+				me->action == MA_GOTO ||
+				me->action == MA_GOTO_UNRES))
 	    m->defentry = m->nentries - 1;
     }
 


More information about the Syslinux-commits mailing list