diff --git a/src/bin/e_int_menus.c b/src/bin/e_int_menus.c index c7b00306d..48fbd82ba 100644 --- a/src/bin/e_int_menus.c +++ b/src/bin/e_int_menus.c @@ -1642,7 +1642,10 @@ _e_int_menus_clients_title_abbrv(const char *title) /* Advance to the end of the first half of the string. */ len = 0; for (len2 = (max_len / 2); len2; len2--) - if (!eina_unicode_utf8_next_get(title, &len)) break; + { + Eina_Unicode u = eina_unicode_utf8_next_get(title, &len); + if ((!u) || ((u >= 0xdc80) && (u <= 0xdcff))) break; + } strncat(abbvptr, title, len); abbvptr += len; diff --git a/src/modules/everything/evry_util.c b/src/modules/everything/evry_util.c index 6c8c1178b..cfc8f9db4 100644 --- a/src/modules/everything/evry_util.c +++ b/src/modules/everything/evry_util.c @@ -49,6 +49,14 @@ evry_util_file_detail_set(Evry_Item_File *file) E_FREE(dir); } +static inline Eina_Unicode +_evry_utf8_next(const char *buf, int *iindex) +{ + Eina_Unicode u = eina_unicode_utf8_next_get(buf, iindex); + if ((!u) || ((u >= 0xdc80) && (u <= 0xdcff))) return 0; + return u; +} + int evry_fuzzy_match(const char *str, const char *match) { @@ -131,7 +139,7 @@ evry_fuzzy_match(const char *str, const char *match) ii = 0; /* go to next word */ for (; (*p != 0) && ((isspace(*p) || (ip && ispunct(*p)))); p += ii) - if (!eina_unicode_utf8_next_get(p, &ii)) break; + if (!_evry_utf8_next(p, &ii)) break; cnt++; next = p; m_cnt = 0; @@ -167,7 +175,7 @@ evry_fuzzy_match(const char *str, const char *match) /* try next char of match */ ii = 0; - if (!eina_unicode_utf8_next_get(m, &ii)) continue; + if (!_evry_utf8_next(m, &ii)) continue; m += ii; if (*m != 0 && !isspace(*m)) continue; @@ -183,7 +191,7 @@ evry_fuzzy_match(const char *str, const char *match) ii = 0; /* go to next match */ for (; (m[0] && m[ii]) && !isspace(*m); m += ii) - if (!eina_unicode_utf8_next_get(m, &ii)) break; + if (!_evry_utf8_next(m, &ii)) break; } if (m_cnt < m_num - 1) @@ -191,7 +199,7 @@ evry_fuzzy_match(const char *str, const char *match) ii = 0; /* test next match */ for (; (m[0] && m[ii]) && !isspace(*m); m += ii) - if (!eina_unicode_utf8_next_get(m, &ii)) break; + if (!_evry_utf8_next(m, &ii)) break; m_cnt++; break; } @@ -203,14 +211,14 @@ evry_fuzzy_match(const char *str, const char *match) !((isspace(*p) || (ip && ispunct(*p)))); p += ii) { - if (!eina_unicode_utf8_next_get(p, &ii)) break; + if (!_evry_utf8_next(p, &ii)) break; } ii = 0; for (; (p[0] && (s_len - (p - str) >= (unsigned int)ii)) && ((isspace(*p) || (ip && ispunct(*p)))); p += ii) { - if (!eina_unicode_utf8_next_get(p, &ii)) break; + if (!_evry_utf8_next(p, &ii)) break; } cnt++; next = p;