From e1e7272d89e2921902161be225b53661ca91af8b Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Sun, 22 Mar 2020 18:39:54 +0000 Subject: ecore evas cnp x - fix nul byte extras when text pasting to other apps i was seeing junk bytes in pastes to chromium... it was an extra nul byte. this will special-case nuke that. --- src/modules/ecore_evas/engines/x/ecore_evas_x.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/modules/ecore_evas/engines/x/ecore_evas_x.c b/src/modules/ecore_evas/engines/x/ecore_evas_x.c index ed95594413..3a61baaa20 100644 --- a/src/modules/ecore_evas/engines/x/ecore_evas_x.c +++ b/src/modules/ecore_evas/engines/x/ecore_evas_x.c @@ -4044,6 +4044,18 @@ _eina_content_converter(char *target, void *data, int size EINA_UNUSED, void **d *ttype = ecore_x_atom_get(target); //use here target in order to get the correct atom //FIXME in selection manager we never set here the typesize, isn't that weird ? ret = EINA_TRUE; + // XXX: fixup for strings to not include nul byte if last + // byte is nul byte + if (((!strncmp(target, "text/", 5)) || + (!strcmp(target, "tex")) || + (!strcmp(target, "TEXT")) || + (!strcmp(target, "COMPOUND_TEXT")) || + (!strcmp(target, "STRING")) || + (!strcmp(target, "UTF8_STRING"))) && + (slice.len > 0) && (slice.bytes[slice.len - 1] == '\0')) + { + *size_ret = *size_ret - 1; + } break; } } -- cgit v1.2.1