string.rb (each_line): may truncate string by mistake; fix #5727

This commit is contained in:
Yukihiro "Matz" Matsumoto
2022-06-24 13:23:21 +09:00
parent 22d0f4580e
commit 89f22158d3
+2 -2
View File
@@ -27,8 +27,8 @@ class String
end
start = 0
string = dup
self_len = length
sep_len = separator.length
self_len = self.bytesize
sep_len = separator.bytesize
while (pointer = string.byteindex(separator, start))
pointer += sep_len