summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1994-05-05 06:31:28 +0000
committerKarl Heuer <kwzh@gnu.org>1994-05-05 06:31:28 +0000
commit742f715d96986d8c3e9198579d5de5f1a65cbe0a (patch)
tree10f1e704c7f776f865a19af5a9728ba2c2f895d2 /src
parentb137c5822bc63a8c678d2ceb2688a7504cb98bd9 (diff)
downloademacs-742f715d96986d8c3e9198579d5de5f1a65cbe0a.tar.gz
(xmenu_show): Disallow empty menus.
Diffstat (limited to 'src')
-rw-r--r--src/xmenu.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/xmenu.c b/src/xmenu.c
index 7764ce3cd83..c22d258cbd1 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -1399,6 +1399,11 @@ xmenu_show (f, x, y, menubarp, keymaps, title, error)
*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 @@ xmenu_show (f, x, y, menubarp, keymaps, title, error)
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,