changeset 7335:73d1276933e1

(xmenu_show): Disallow empty menus.
author Karl Heuer <kwzh@gnu.org>
date Thu, 05 May 1994 06:31:28 +0000
parents fcea4173315d
children be8a00515620
files src/xmenu.c
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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,