aboutsummaryrefslogtreecommitdiffstats
path: root/menu
diff options
context:
space:
mode:
authorMurali Ganapathy <murali@integral.(none)>2008-06-22 23:04:11 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-06-23 23:16:32 -0700
commit0090618c178c8e57983fc347ef940e63738586d7 (patch)
tree6d7a6cc78d2aaa1324241d4b33d111552cb767b8 /menu
parent7edf0a4cc227fc7c7cbe36a95bc2e4cd83414380 (diff)
downloadsyslinux-elf-0090618c178c8e57983fc347ef940e63738586d7.tar.gz
syslinux-elf-0090618c178c8e57983fc347ef940e63738586d7.tar.xz
syslinux-elf-0090618c178c8e57983fc347ef940e63738586d7.zip
complex menu: Fixed bug in menu.c so complex.c32 works again.
Avoid crashing in the presence of unnamed submenus.
Diffstat (limited to 'menu')
-rw-r--r--menu/libmenu/menu.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/menu/libmenu/menu.c b/menu/libmenu/menu.c
index 841e59ca..56a7426c 100644
--- a/menu/libmenu/menu.c
+++ b/menu/libmenu/menu.c
@@ -695,10 +695,11 @@ void fix_submenus()
for (j=0; j < m->numitems; j++)
{
mi = m->items[j];
- // if submenu with non-trivial data string
- // again using hack that itemdata is a union data type
- if ( mi->data && ((mi->action == OPT_SUBMENU) || (mi->action == OPT_RADIOMENU)) )
+ // if item is a submenu and has non-empty non-trivial data string
+ if (mi->data && strlen(mi->data) > 0 &&
+ ((mi->action == OPT_SUBMENU) || (mi->action == OPT_RADIOMENU)) ) {
mi->itemdata.submenunum = find_menu_num (mi->data);
+ }
}
}
}