diff options
Diffstat (limited to 'regenc.c')
-rw-r--r-- | regenc.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -55,12 +55,10 @@ extern int onigenc_mbclen_approximate(const OnigUChar* p,const OnigUChar* e, struct OnigEncodingTypeST* enc) { int ret = ONIGENC_PRECISE_MBC_ENC_LEN(enc,p,e); - if (ONIGENC_MBCLEN_NEEDMORE_P(ret)) - return (int)(e-p)+ONIGENC_MBCLEN_NEEDMORE_LEN(ret); - else if (ONIGENC_MBCLEN_INVALID_P(ret)) - return (int)(e-p)+ONIGENC_MBCLEN_INVALID_LEN(ret); - else if (ONIGENC_MBCLEN_CHARFOUND_P(ret)) + if (ONIGENC_MBCLEN_CHARFOUND_P(ret)) return ONIGENC_MBCLEN_CHARFOUND_LEN(ret); + else if (ONIGENC_MBCLEN_NEEDMORE_P(ret)) + return (int)(e-p)+ONIGENC_MBCLEN_NEEDMORE_LEN(ret); return 1; } |