summary refs log tree commit diff
path: root/gnu/packages/patches/emacs-ignore-empty-xim-styles.patch
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/patches/emacs-ignore-empty-xim-styles.patch')
-rw-r--r--gnu/packages/patches/emacs-ignore-empty-xim-styles.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/gnu/packages/patches/emacs-ignore-empty-xim-styles.patch b/gnu/packages/patches/emacs-ignore-empty-xim-styles.patch
new file mode 100644
index 0000000000..398e65bdc8
--- /dev/null
+++ b/gnu/packages/patches/emacs-ignore-empty-xim-styles.patch
@@ -0,0 +1,24 @@
+Fix contributed upstream here:
+https://debbugs.gnu.org/cgi/bugreport.cgi?bug=42694.
+
+Index: emacs-26.3/src/xfns.c
+===================================================================
+--- emacs-26.3.orig/src/xfns.c
++++ emacs-26.3/src/xfns.c
+@@ -2628,6 +2628,8 @@ xic_free_xfontset (struct frame *f)
+ static XIMStyle
+ best_xim_style (XIMStyles *xim)
+ {
++  if (xim == NULL) goto out;
++
+   int i, j;
+   int nr_supported = ARRAYELTS (supported_xim_styles);
+
+@@ -2636,6 +2638,7 @@ best_xim_style (XIMStyles *xim)
+       if (supported_xim_styles[i] == xim->supported_styles[j])
+	return supported_xim_styles[i];
+
++ out:
+   /* Return the default style.  */
+   return XIMPreeditNothing | XIMStatusNothing;
+ }