# HG changeset patch # User Jerry James # Date 1358788675 25200 # Node ID 489e76b8582868ac588551ea0565ef43e695da54 # Parent 8b5bdc8aebfd835411a42e614d2ef41fe4b51a1c When an error is encountered while converting a Lisp menu specification to its internal form, don't fail an assert(). Instead, return 0 to skip the fault menu and show any errors in *Warnings*. diff -r 8b5bdc8aebfd -r 489e76b85828 src/ChangeLog --- a/src/ChangeLog Sat Jan 05 02:11:23 2013 +0900 +++ b/src/ChangeLog Mon Jan 21 10:17:55 2013 -0700 @@ -1,3 +1,9 @@ +2013-01-16 Jerry James + + * menubar-x.c (set_frame_menubar): when a menubar specification has an + error, don't fail an assert() and bring XEmacs down. Instead, return + 0 to skip the faulty menu and show any errors in *Warnings*. + 2013-01-04 Stephen J. Turnbull * XEmacs 21.5.33 "horseradish" is released. diff -r 8b5bdc8aebfd -r 489e76b85828 src/menubar-x.c --- a/src/menubar-x.c Sat Jan 05 02:11:23 2013 +0900 +++ b/src/menubar-x.c Mon Jan 21 10:17:55 2013 -0700 @@ -516,6 +516,9 @@ } } +/* Returns the converted menubar, or NULL if an error is encountered while + * converting the Lisp menu specification. + */ static widget_value * compute_menubar_data (struct frame *f, Lisp_Object menubar, int deep_p) { @@ -573,7 +576,8 @@ menubar_visible = !NILP (w->menubar_visible_p); data = compute_menubar_data (f, menubar, deep_p); - assert (data && (data->next || data->contents)); + if (!data || (!data->next && !data->contents)) + return 0; if (!FRAME_X_MENUBAR_ID (f)) FRAME_X_MENUBAR_ID (f) = new_lwlib_id (); @@ -594,6 +598,8 @@ { free_popup_widget_value_tree (data); data = compute_menubar_data (f, menubar, 1); + if (!data || (!data->next && !data->contents)) + return 0; }