aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ace-of-penguins/fix-font.patch
diff options
context:
space:
mode:
Diffstat (limited to 'testing/ace-of-penguins/fix-font.patch')
-rw-r--r--testing/ace-of-penguins/fix-font.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/testing/ace-of-penguins/fix-font.patch b/testing/ace-of-penguins/fix-font.patch
new file mode 100644
index 00000000000..6326dc917b2
--- /dev/null
+++ b/testing/ace-of-penguins/fix-font.patch
@@ -0,0 +1,24 @@
+Without this patch, trying to open the help screen could make the program
+segfault if the appropriate fonts weren't installed.
+
+--- ace-1.4/lib/help.c 2022-02-17 03:11:56.410174316 +0000
++++ ace-1.4-alpine/lib/help.c 2022-02-17 03:46:31.476912695 +0000
+@@ -179,7 +179,18 @@
+ for (i=0; i<17; i++)
+ {
+ if (!fonts[i])
++ {
+ fonts[i] = XLoadQueryFont(display, i & STYLE_TT ? "fixed" : "variable");
++ if (!fonts[i])
++ {
++ int count;
++ char **fontlist = XListFonts(display, "*", 1, &count);
++ if (count == 0)
++ abort();
++ fonts[i] = XLoadQueryFont(display, fontlist[0]);
++ XFreeFontNames(fontlist);
++ }
++ }
+ thin_space[i] = XTextWidth(fonts[i], " ", 1);
+ }
+ for (i=0; i<NTAGS; i++)