[dev] [PATCH] Handle pasting of empty selection.

From: Alex Pilon <alp_AT_alexpilon.ca>
Date: Mon, 16 Mar 2015 11:51:23 -0400

Otherwise, pasting the X11 primary selection when empty results an
error and Xlib forcibly exits.
---
 st.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/st.c b/st.c
index ac91d9f..cd470e7 100644
--- a/st.c
+++ b/st.c
_AT_@ -1012,6 +1012,8 @@ selnotify(XEvent *e) {
 
 	ofs = 0;
 	xsev = (XSelectionEvent *)e;
+	if (xsev->property == None)
+	    return;
 	do {
 		if(XGetWindowProperty(xw.dpy, xw.win, xsev->property, ofs,
 					BUFSIZ/4, False, AnyPropertyType,
-- 
2.3.3

Received on Mon Mar 16 2015 - 16:51:23 CET

This archive was generated by hypermail 2.3.0 : Mon Mar 16 2015 - 17:00:10 CET