Don't use broken mblen() on AROS

This commit is contained in:
Brian Cox 2016-06-04 00:15:29 -07:00
parent afd11628fd
commit acddeb3ae2
1 changed files with 13 additions and 0 deletions

View File

@ -83,12 +83,25 @@ bool cCharUtil::PeekNextChar( const TSTRING::const_iterator& cur,
}
first = cur;
if (!(*cur))
{
last = cur;
}
else
{
#ifndef __AROS__
mblen (NULL, 0);
int len = mblen(&*cur, MB_CUR_MAX);
if (len < 0) //invalid multibyte sequence, but let's not blow up.
len = 1;
last = cur + len;
#else // AROS mblen() seems broken (as of 6/2016) so don't use it.
last = cur + 1;
#endif
}
return true;
}