changeset 39507:24530f82048e

(set_frame_menubar): Take into account that f->menu_bar_vector can be nil, and not a vector. From Ken Raeburn <raeburn@gnu.org>.
author Andrew Innes <andrewi@gnu.org>
date Sun, 30 Sep 2001 21:54:04 +0000
parents a9746e8cd6d7
children 08778971ecea
files src/w32menu.c
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/w32menu.c	Sun Sep 30 10:48:42 2001 +0000
+++ b/src/w32menu.c	Sun Sep 30 21:54:04 2001 +0000
@@ -1355,12 +1355,13 @@
       inhibit_garbage_collection ();
 
       /* Save the frame's previous menu bar contents data.  */
-      bcopy (XVECTOR (f->menu_bar_vector)->contents, previous_items,
-	     previous_menu_items_used * sizeof (Lisp_Object));
+      if (previous_menu_items_used)
+	bcopy (XVECTOR (f->menu_bar_vector)->contents, previous_items,
+	       previous_menu_items_used * sizeof (Lisp_Object));
 
       /* Fill in the current menu bar contents.  */
       menu_items = f->menu_bar_vector;
-      menu_items_allocated = XVECTOR (menu_items)->size;
+      menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0;
       init_menu_items ();
       for (i = 0; i < XVECTOR (items)->size; i += 4)
 	{