Commit 25fb3d74 authored by Andreas Schwab's avatar Andreas Schwab
Browse files

* xmenu.c (set_frame_menubar): Fix submenu loops.

parent 14fe7b53
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.
......
......@@ -1058,21 +1058,20 @@ set_frame_menubar (f, first_time, deep_p)
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;
......@@ -1099,7 +1098,7 @@ set_frame_menubar (f, first_time, deep_p)
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],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment