From: Gerd Moellmann Date: Mon, 30 Jul 2001 08:12:46 +0000 (+0000) Subject: (set_frame_menubar): Take into account that X-Git-Tag: emacs-pretest-21.0.105~363 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=86c041835c3afa2d324377e322a7acfca133a9d2;p=emacs.git (set_frame_menubar): Take into account that f->menu_bar_vector can be nil, and not a vector. From Ken Raeburn . --- diff --git a/src/xmenu.c b/src/xmenu.c index d6ee9056a55..b33e8f0e591 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -1690,12 +1690,13 @@ set_frame_menubar (f, first_time, deep_p) 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) {