зеркало из https://github.com/github/ruby.git
* 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:
Родитель
6c6cf008cd
Коммит
cde5b2a9cf
|
@ -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>
|
||||
|
||||
* signal.c (posix_signal): return value.
|
||||
|
|
|
@ -486,7 +486,8 @@ int
|
|||
rb_enc_mbclen(const char *p, const char *e, rb_encoding *enc)
|
||||
{
|
||||
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;
|
||||
else
|
||||
return 1;
|
||||
|
|
Загрузка…
Ссылка в новой задаче