Re: [patch] editor/emacs: crash in Mew

2021-02-27 Thread Jeremie Courreges-Anglas
On Sat, Feb 27 2021, YASUOKA Masahiko  wrote:
> Hi,
>
> I'd like to add a patch to avoid crashes in Mew.  When I am composing
> mail messages on Mew, emacs crashes frequently.  The patch fixes this
> problem and come from the upstream.
>
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=46791 is the bug
> tracking page of the upstream.
>
> ok?

ok, please add the debbugs url as a comment in the patch.

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE



[patch] editor/emacs: crash in Mew

2021-02-27 Thread YASUOKA Masahiko
Hi,

I'd like to add a patch to avoid crashes in Mew.  When I am composing
mail messages on Mew, emacs crashes frequently.  The patch fixes this
problem and come from the upstream.

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=46791 is the bug
tracking page of the upstream.

ok?

Index: Makefile
===
RCS file: /disk/cvs/openbsd/ports/editors/emacs/Makefile,v
retrieving revision 1.96
diff -u -p -r1.96 Makefile
--- Makefile23 Aug 2020 09:55:00 -  1.96
+++ Makefile27 Feb 2021 10:26:45 -
@@ -3,6 +3,7 @@
 COMMENT=   GNU editor: extensible, customizable, self-documenting
 
 VERSION=   27.1
+REVISION=  0
 DISTNAME=  emacs-${VERSION}
 
 CATEGORIES=editors
Index: patches/patch-src_gtkutil_c
===
RCS file: patches/patch-src_gtkutil_c
diff -N patches/patch-src_gtkutil_c
--- /dev/null   1 Jan 1970 00:00:00 -
+++ patches/patch-src_gtkutil_c 27 Feb 2021 10:26:45 -
@@ -0,0 +1,48 @@
+$OpenBSD$
+
+Index: src/gtkutil.c
+--- src/gtkutil.c.orig
 src/gtkutil.c
+@@ -5019,11 +5019,10 @@ update_frame_tool_bar (struct frame *f)
+   GtkWidget *wbutton = NULL;
+   Lisp_Object specified_file;
+   bool vert_only = ! NILP (PROP (TOOL_BAR_ITEM_VERT_ONLY));
+-  const char *label
+-  = (EQ (style, Qimage) || (vert_only && horiz)) ? NULL
+-  : STRINGP (PROP (TOOL_BAR_ITEM_LABEL))
+-  ? SSDATA (PROP (TOOL_BAR_ITEM_LABEL))
+-  : "";
++  Lisp_Object label
++  = (EQ (style, Qimage) || (vert_only && horiz))
++  ? Qnil
++  : PROP (TOOL_BAR_ITEM_LABEL);
+ 
+   ti = gtk_toolbar_get_nth_item (GTK_TOOLBAR (wtoolbar), j);
+ 
+@@ -5136,8 +5135,11 @@ update_frame_tool_bar (struct frame *f)
+ 
+   /* If there is an existing widget, check if it's stale; if so,
+remove it and make a new tool item from scratch.  */
+-  if (ti && xg_tool_item_stale_p (wbutton, stock_name, icon_name,
+-img, label, horiz))
++  if (ti && xg_tool_item_stale_p (wbutton, stock_name, icon_name, img,
++NILP (label)
++? NULL
++: STRINGP (label) ? SSDATA (label) : "",
++horiz))
+   {
+ gtk_container_remove (GTK_CONTAINER (wtoolbar),
+   GTK_WIDGET (ti));
+@@ -5194,7 +5196,11 @@ update_frame_tool_bar (struct frame *f)
+ #else
+ if (w) gtk_misc_set_padding (GTK_MISC (w), hmargin, vmargin);
+ #endif
+-  ti = xg_make_tool_item (f, w, , label, i, horiz, 
text_image);
++  ti = xg_make_tool_item (f, w, ,
++NILP (label)
++? NULL
++: STRINGP (label) ? SSDATA (label) : "",
++i, horiz, text_image);
+   gtk_toolbar_insert (GTK_TOOLBAR (wtoolbar), ti, j);
+ }
+