diff options
author | John F. Carr <jfc@mit.edu> | 1991-08-08 03:53:13 +0000 |
---|---|---|
committer | John F. Carr <jfc@mit.edu> | 1991-08-08 03:53:13 +0000 |
commit | 8878dea2cb4586e81b383b2e5ffe751a00b705cc (patch) | |
tree | bb906e6b236e5f33815b99de0b52bc0a5d8ca0eb | |
parent | aec86bda0a49ca04ce156f4ae28e16e4c3c72266 (diff) |
Don't dump core on ICCCM violations.
-rw-r--r-- | zwgc/xselect.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/zwgc/xselect.c b/zwgc/xselect.c index 85303a2..f691514 100644 --- a/zwgc/xselect.c +++ b/zwgc/xselect.c @@ -111,9 +111,17 @@ static void xselSetProperties(dpy,w,property,target,selreq) } else if (target==XA_STRING) { char *selected; - selected=getSelectedText(); - - ChangeProp(XA_STRING,8,selected,string_Length(selected)); + if (selected = getSelectedText()) { + ChangeProp(XA_STRING,8,selected,string_Length(selected)); + } else { + /* This should only happen if the pasting client is out of + spec (or if this program is buggy), but it could happen */ +#ifdef DEBUG + fprintf(stderr, + "SelectionRequest event received for unowned selection: requestor wid=0x%x", w); +#endif + ChangeProp(XA_STRING,8,"",0); + } XSync(dpy,0); } |