# HG changeset patch # User Karl Heuer # Date 768119488 0 # Node ID 73d1276933e1a36c87fc66cc596ec71ba29e568d # Parent fcea4173315dc3f9a98ed9cb5c448a60e869241f (xmenu_show): Disallow empty menus. diff -r fcea4173315d -r 73d1276933e1 src/xmenu.c --- a/src/xmenu.c Thu May 05 05:36:17 1994 +0000 +++ b/src/xmenu.c Thu May 05 06:31:28 1994 +0000 @@ -1399,6 +1399,11 @@ *error = NULL; + if (menu_items_used <= MENU_ITEMS_PANE_LENGTH) + { + *error = "Empty menu"; + return Qnil; + } this_menu_bar_item_beg = -1; this_menu_bar_item_end = -1; last_menu_bar_item_end = -1; @@ -2010,6 +2015,12 @@ if (menu_items_n_panes == 0) return Qnil; + if (menu_items_used <= MENU_ITEMS_PANE_LENGTH) + { + *error = "Empty menu"; + return Qnil; + } + /* Figure out which root window F is on. */ XGetGeometry (x_current_display, FRAME_X_WINDOW (f), &root, &dummy_int, &dummy_int, &dummy_uint, &dummy_uint,