+2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
+
+ * xmenu.c (set_frame_menubar): Fix submenu loops.
+
2011-05-09 Eli Zaretskii <eliz@gnu.org>
Backport revisions 103939.1.41..103939.1.44 (inclusive) from trunk.
menu_items = f->menu_bar_vector;
menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0;
subitems = XVECTOR_SIZE (items) / 4;
- submenu_start = (int *) alloca (subitems * sizeof (int *));
- submenu_end = (int *) alloca (subitems * sizeof (int *));
+ submenu_start = (int *) alloca (subitems * sizeof (int));
+ submenu_end = (int *) alloca (subitems * sizeof (int));
submenu_n_panes = (int *) alloca (subitems * sizeof (int));
- submenu_top_level_items
- = (int *) alloca (subitems * sizeof (int *));
+ submenu_top_level_items = (int *) alloca (subitems * sizeof (int));
init_menu_items ();
- for (i = 0; i < subitems; i += 4)
+ for (i = 0; i < subitems; i++)
{
Lisp_Object key, string, maps;
last_i = i;
- key = XVECTOR (items)->contents[i];
- string = XVECTOR (items)->contents[i + 1];
- maps = XVECTOR (items)->contents[i + 2];
+ key = XVECTOR (items)->contents[i * 4];
+ string = XVECTOR (items)->contents[i * 4 + 1];
+ maps = XVECTOR (items)->contents[i * 4 + 2];
if (NILP (string))
break;
wv->help = Qnil;
first_wv = wv;
- for (i = 0; i < last_i; i += 4)
+ for (i = 0; i < last_i; i++)
{
menu_items_n_panes = submenu_n_panes[i];
wv = digest_single_submenu (submenu_start[i], submenu_end[i],