aboutsummaryrefslogtreecommitdiffstats
path: root/regenc.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-09 07:38:15 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-09 07:38:15 +0000
commit9ae509504bf6535ee1799ce60010fb0f4865c94d (patch)
tree7c11d90f1d2dc9cfde59c564e1d954977b911f3f /regenc.c
parentb0bc85f933b3c76ff97fe5c8f8e22c87cb8c40f7 (diff)
downloadruby-9ae509504bf6535ee1799ce60010fb0f4865c94d.tar.gz
Revert r41786 "broken utf-8"
revert unexpected commit git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regenc.c')
-rw-r--r--regenc.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/regenc.c b/regenc.c
index fc039154b4..288eac433d 100644
--- a/regenc.c
+++ b/regenc.c
@@ -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;
}