mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* string.c (rb_enc_strlen_cr): increment by rb_enc_mbminlen(enc) for
broken byte sequence. [ruby-core:27748] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
cb9da52cde
commit
4b8e14c978
2 changed files with 9 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
Sun Jan 24 13:55:54 2010 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* string.c (rb_enc_strlen_cr): increment by rb_enc_mbminlen(enc) for
|
||||
broken byte sequence. [ruby-core:27748]
|
||||
|
||||
Sun Jan 24 05:18:34 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* thread.c (thread_start_func_2): unlock all locking mutexes
|
||||
|
|
5
string.c
5
string.c
|
@ -1008,7 +1008,10 @@ rb_enc_strlen_cr(const char *p, const char *e, rb_encoding *enc, int *cr)
|
|||
}
|
||||
else {
|
||||
*cr = ENC_CODERANGE_BROKEN;
|
||||
p++;
|
||||
if (p + rb_enc_mbminlen(enc) <= e)
|
||||
p += rb_enc_mbminlen(enc);
|
||||
else
|
||||
p = e;
|
||||
}
|
||||
}
|
||||
if (!*cr) *cr = ENC_CODERANGE_7BIT;
|
||||
|
|
Loading…
Reference in a new issue