From 87a745b9adf5ceb97c79c6e0acba4d63909ff87a Mon Sep 17 00:00:00 2001 From: devilhorns Date: Wed, 20 Jun 2012 08:00:44 +0000 Subject: [PATCH] Ecore_X(cb): Do not use UTF8_STRING as a valid target unless ICONV support is built in. Fix stefan's segfault wrt terminology pasting. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@72526 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/ecore_x/xcb/ecore_xcb_selection.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/lib/ecore_x/xcb/ecore_xcb_selection.c b/src/lib/ecore_x/xcb/ecore_xcb_selection.c index 7b994bd..afb1b8c 100644 --- a/src/lib/ecore_x/xcb/ecore_xcb_selection.c +++ b/src/lib/ecore_x/xcb/ecore_xcb_selection.c @@ -696,8 +696,10 @@ _ecore_xcb_selection_converter_text(char *target, style = XcbCompoundTextStyle; else if (!strcmp(target, ECORE_X_SELECTION_TARGET_STRING)) style = XcbStringStyle; +#ifdef HAVE_ICONV else if (!strcmp(target, ECORE_X_SELECTION_TARGET_UTF8_STRING)) style = XcbUTF8StringStyle; +#endif else return EINA_FALSE; @@ -734,8 +736,6 @@ _ecore_xcb_selection_converter_text(char *target, #endif else return EINA_TRUE; - - return EINA_FALSE; } static void * @@ -958,14 +958,8 @@ _ecore_xcb_selection_data_targets_free(void *data) LOGFN(__FILE__, __LINE__, __FUNCTION__); if (!(sel = data)) return 0; - if (sel->targets) - { - int i = 0; - - for (i = 0; i < sel->num_targets; i++) - if (sel->targets[i]) free(sel->targets[i]); - if (sel->targets) free(sel->targets); - } + if (sel->targets) free(sel->targets); + free(ECORE_XCB_SELECTION_DATA(sel)->data); free(sel); return 1; } -- 2.7.4