summaryrefslogtreecommitdiff
path: root/platform/gl/gl-main.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2015-09-03 14:43:30 +0200
committerTor Andersson <tor.andersson@artifex.com>2015-10-06 11:21:23 +0200
commite526430ba459b09ed854c462a75e0dbb5ff210d7 (patch)
tree11a22744ac9b0b8114447a116300cd83ce04d7ca /platform/gl/gl-main.c
parente982f5c7dd626b5b6051a835dd33c817100f7c2d (diff)
downloadmupdf-e526430ba459b09ed854c462a75e0dbb5ff210d7.tar.xz
gl: Use UTF-8 string internally in text field.
Diffstat (limited to 'platform/gl/gl-main.c')
-rw-r--r--platform/gl/gl-main.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/platform/gl/gl-main.c b/platform/gl/gl-main.c
index d85b7df7..8acb0baa 100644
--- a/platform/gl/gl-main.c
+++ b/platform/gl/gl-main.c
@@ -309,25 +309,6 @@ static void pop_future(void)
push_history();
}
-static char *
-utf8_from_rune_string(fz_context *ctx, const int *s, const int *e)
-{
- const int *src = s;
- char *d, *dst;
- int len = 1;
-
- while (src < e)
- len += fz_runelen(*src++);
-
- dst = d = fz_malloc(ctx, len);
- src = s;
- while (src < e)
- dst += fz_runetochar(dst, *src++);
- *dst = 0;
-
- return d;
-}
-
void do_search_page(int number, char *needle, fz_cookie *cookie)
{
fz_page *page = fz_load_page(ctx, doc, number);
@@ -1101,7 +1082,7 @@ static void run_main_loop(void)
}
if (search_input.end > search_input.text)
{
- search_needle = utf8_from_rune_string(ctx, search_input.text, search_input.end);
+ search_needle = fz_strdup(ctx, search_input.text);
search_active = 1;
search_page = currentpage;
}