mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
Introduce at_char_boundary
function
This commit is contained in:
parent
cfdbbd6726
commit
00ac3a64ba
Notes:
git
2023-08-25 23:58:23 +00:00
4 changed files with 12 additions and 8 deletions
3
io.c
3
io.c
|
@ -4144,8 +4144,7 @@ rb_io_getline_0(VALUE rs, long limit, int chomp, rb_io_t *fptr)
|
|||
s = RSTRING_PTR(str);
|
||||
e = RSTRING_END(str);
|
||||
p = e - rslen;
|
||||
pp = rb_enc_left_char_head(s, p, e, enc);
|
||||
if (pp != p) continue;
|
||||
if (!at_char_boundary(s, p, e, enc)) continue;
|
||||
if (!rspara) rscheck(rsptr, rslen, rs);
|
||||
if (memcmp(p, rsptr, rslen) == 0) {
|
||||
if (chomp) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue