mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* encoding.c (rb_enc_mbclen): return 1 if underlying implementation
returns a length longer than e-p. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6c6cf008cd
commit
cde5b2a9cf
2 changed files with 7 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Sun Dec 9 03:29:02 2007 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* encoding.c (rb_enc_mbclen): return 1 if underlying implementation
|
||||||
|
returns a length longer than e-p.
|
||||||
|
|
||||||
Sat Dec 8 17:59:40 2007 Tanaka Akira <akr@fsij.org>
|
Sat Dec 8 17:59:40 2007 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* signal.c (posix_signal): return value.
|
* signal.c (posix_signal): return value.
|
||||||
|
|
|
@ -486,7 +486,8 @@ int
|
||||||
rb_enc_mbclen(const char *p, const char *e, rb_encoding *enc)
|
rb_enc_mbclen(const char *p, const char *e, rb_encoding *enc)
|
||||||
{
|
{
|
||||||
int n = ONIGENC_PRECISE_MBC_ENC_LEN(enc, (UChar*)p, (UChar*)e);
|
int n = ONIGENC_PRECISE_MBC_ENC_LEN(enc, (UChar*)p, (UChar*)e);
|
||||||
if (MBCLEN_CHARFOUND(n))
|
n = MBCLEN_CHARFOUND(n);
|
||||||
|
if (0 < n && n <= e-p)
|
||||||
return n;
|
return n;
|
||||||
else
|
else
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in a new issue