6 Nov
2023
6 Nov
'23
12:06 p.m.
Piotr Caban (@piotr) commented about dlls/msvcrt/mbcs.c:
+ /* Lead bytes can also be trail bytes so we need to analyse the string. + * Also we must return _MBC_ILLEGAL for chars past the end of the string + */ + while (str < end) /* Note: we skip the last byte - will check after the loop */ + { + if (!*str) + return _MBC_ILLEGAL; + lead = mbcinfo->ismbcodepage && !lead && _ismbblead_l(*str, locale); + str++; + } + + if (lead) + if (_ismbbtrail_l(*str, locale)) + return _MBC_TRAIL; + else + return _MBC_ILLEGAL;
if (lead)
{
if (_ismbbtrail_l(*str, locale))
return _MBC_TRAIL;
else
return _MBC_ILLEGAL;
}
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/4284#note_51015