summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2010-12-07 18:25:15 +0000
committerManolo Gouy <Manolo>2010-12-07 18:25:15 +0000
commit271e1d821280ade24196185acaec1847b199605a (patch)
tree75901625c6e973224a95b29b31d2891752a1bde7
parent0db080e76215c1d5cfcb2451b75da9bfaae708b5 (diff)
Fix STR #2470. Don't call Xutf8TextPropertyToTextList if X_HAVE_UTF8_STRING isn't defined
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7970 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--src/Fl_x.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx
index e85ae33c3..791d5d35d 100644
--- a/src/Fl_x.cxx
+++ b/src/Fl_x.cxx
@@ -955,14 +955,19 @@ int fl_handle(const XEvent& thisevent)
text_prop.encoding=actual;
text_prop.nitems=count;
char **text_list;
+#ifndef X_HAVE_UTF8_STRING
+ text_list = (char**)&portion;
+#else
int list_count;
- Xutf8TextPropertyToTextList(fl_display,
- + (const XTextProperty*)&text_prop, &text_list, &list_count);
+ Xutf8TextPropertyToTextList(fl_display, (const XTextProperty*)&text_prop, &text_list, &list_count);
+#endif
int bytesnew = strlen(*text_list)+1;
- XFree(portion);
buffer = (unsigned char*)realloc(buffer, bytesread+bytesnew+remaining);
memcpy(buffer+bytesread, *text_list, bytesnew);
+ XFree(portion);
+#ifdef X_HAVE_UTF8_STRING
XFreeStringList(text_list);
+#endif
bytesread += bytesnew - 1;
if (!remaining) break;
}