Add an error for XftFontOpenPattern failure.
[st.git] / x.c
diff --git a/x.c b/x.c
index ab9593e..191e5dc 100644 (file)
--- a/x.c
+++ b/x.c
@@ -507,7 +507,6 @@ xsetsel(char *str, Time t)
        XSetSelectionOwner(xw.dpy, XA_PRIMARY, xw.win, t);
        if (XGetSelectionOwner(xw.dpy, XA_PRIMARY) != xw.win)
                selclear_(NULL);
-       xclipcopy();
 }
 
 void
@@ -1093,6 +1092,9 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x
 
                        frc[frclen].font = XftFontOpenPattern(xw.dpy,
                                        fontpattern);
+                       if (!frc[frclen].font)
+                               die("XftFontOpenPattern failed seeking fallback font: %s\n",
+                                       strerror(errno));
                        frc[frclen].flags = frcflags;
                        frc[frclen].unicodep = rune;