while ((m_cnt < m_num) && (*next != 0))
{
+ int ii;
+
/* reset match */
if (m_cnt == 0) m = match;
}
else
{
+ ii = 0;
/* go to next word */
- for (; (*p != 0) && ((isspace(*p) || (ip && ispunct(*p)))); p++) ;
+ for (; (*p != 0) && ((isspace(*p) || (ip && ispunct(*p)))); p += ii)
+ if (!eina_unicode_utf8_next_get(p, &ii)) break;
cnt++;
next = p;
m_cnt = 0;
last = offset;
/* try next char of match */
- if (*(++m) != 0 && !isspace(*m))
+ ii = 0;
+ if (!eina_unicode_utf8_next_get(m, &ii)) continue;
+ m += ii;
+ if (*m != 0 && !isspace(*m))
continue;
/* end of match: store min weight of match */
}
else
{
+ ii = 0;
/* go to next match */
- for (; (*m != 0) && !isspace(*m); m++) ;
+ for (; (*m != 0) && !isspace(*m); m += ii)
+ if (!eina_unicode_utf8_next_get(m, &ii)) break;
}
if (m_cnt < m_num - 1)
{
+ ii = 0;
/* test next match */
- for (; (*m != 0) && isspace(*m); m++) ;
+ for (; (*m != 0) && isspace(*m); m += ii)
+ if (!eina_unicode_utf8_next_get(m, &ii)) break;
m_cnt++;
break;
}
else if (*p != 0)
{
+ ii = 0;
/* go to next word */
- for (; (*p != 0) && !((isspace(*p) || (ip && ispunct(*p)))); p++) ;
- for (; (*p != 0) && ((isspace(*p) || (ip && ispunct(*p)))); p++) ;
+ for (; (*p != 0) && !((isspace(*p) || (ip && ispunct(*p)))); p += ii)
+ if (!eina_unicode_utf8_next_get(p, &ii)) break;
+ ii = 0;
+ for (; (*p != 0) && ((isspace(*p) || (ip && ispunct(*p)))); p += ii)
+ if (!eina_unicode_utf8_next_get(p, &ii)) break;
cnt++;
next = p;
m_cnt = 0;