* Any other failure should just go foom.
* If we have data, but it's not of a type we can deal with, * we have to ignore the data.
void selection_received(GtkWidget *widget, GtkSelectionData *seldata,			guint time, gpointer data){    struct gui_data *inst = (struct gui_data *)data;    XTextProperty tp;    char **list;    char *text;    int length, count, ret;    int free_list_required = 0;    int charset;    if (seldata->target == utf8_string_atom && seldata->length <= 0) {	/*	 * Failed to get a UTF-8 selection string. Try compound	 * text next.	 */	gtk_selection_convert(inst->area, GDK_SELECTION_PRIMARY,			      compound_text_atom,			      inst->input_event_time);	return;    }    if (seldata->target == compound_text_atom && seldata->length <= 0) {	/*	 * Failed to get UTF-8 or compound text. Try an ordinary	 * string.	 */	gtk_selection_convert(inst->area, GDK_SELECTION_PRIMARY,			      GDK_SELECTION_TYPE_STRING,			      inst->input_event_time);	return;    }    /*     * Any other failure should just go foom.     */    if (seldata->length <= 0 ||	(seldata->type != GDK_SELECTION_TYPE_STRING &&	 seldata->type != compound_text_atom &&	 seldata->type != utf8_string_atom))	return;			       /* Nothing happens. */    /*     * Convert COMPOUND_TEXT into UTF-8.     */    if (seldata->type == compound_text_atom) {	tp.value = seldata->data;	tp.encoding = (Atom) seldata->type;	tp.format = seldata->format;	tp.nitems = seldata->length;	ret = Xutf8TextPropertyToTextList(GDK_DISPLAY(), &tp, &list, &count);	if (ret != 0 || count != 1) {	    /*	     * Compound text failed; fall back to STRING.	     */	    gtk_selection_convert(inst->area, GDK_SELECTION_PRIMARY,				  GDK_SELECTION_TYPE_STRING,				  inst->input_event_time);	    return;	}	text = list[0];	length = strlen(list[0]);	charset = CS_UTF8;	free_list_required = 1;    } else {	text = (char *)seldata->data;	length = seldata->length;	charset = (seldata->type == utf8_string_atom ?		   CS_UTF8 : inst->ucsdata.line_codepage);    }    if (inst->pastein_data)	sfree(inst->pastein_data);    inst->pastein_data = snewn(length, wchar_t);    inst->pastein_data_len = length;    inst->pastein_data_len =	mb_to_wc(charset, 0, text, length,		 inst->pastein_data, inst->pastein_data_len);    term_do_paste(inst->term);    if (term_paste_pending(inst->term))	inst->term_paste_idle_id = gtk_idle_add(idle_paste_func, inst);    if (free_list_required)	XFreeStringList(list);}