fix and speed up u8_analyze for our purposes

This commit is contained in:
Wolfgang Bumiller 2012-12-22 22:43:14 +01:00
parent a707440e52
commit ac0ca3de81

View file

@ -74,6 +74,7 @@ bool u8_analyze(const char *_s, size_t *_start, size_t *_len, Uchar *_ch, size_t
/* in gmqcc, invalid / overlong encodings are considered an error
* goto findchar;
*/
if (!s[i]) goto done;
return false;
}
ch = (ch << 6) | (s[i+j] & 0x3F);
@ -87,6 +88,7 @@ bool u8_analyze(const char *_s, size_t *_start, size_t *_len, Uchar *_ch, size_t
return false;
}
done:
if (_start)
*_start = i;
if (_len)