aboutsummaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string.c b/string.c
index 6177059738..9bab8d4411 100644
--- a/string.c
+++ b/string.c
@@ -4896,7 +4896,7 @@ rb_str_each_line(int argc, VALUE *argv, VALUE str)
p++;
continue;
}
- p = p0 + rb_enc_mbclen(s, p0, enc);
+ p = p0 + rb_enc_mbclen(p0, pend, enc);
line = rb_str_new5(str, s, p - s);
OBJ_INFECT(line, str);
rb_enc_copy(line, str);