From ce141b1332e2e41bd4b66803cbb25fc32c8d97b0 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Tue, 17 May 2022 13:52:27 +0900 Subject: [PATCH] string.rb (each_line): should not use [] reference. Use `byteslice` instead. --- mrblib/string.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mrblib/string.rb b/mrblib/string.rb index 94a593f48..ee3d857f7 100644 --- a/mrblib/string.rb +++ b/mrblib/string.rb @@ -38,7 +38,7 @@ class String end return self if start == self_len - block.call(string[start, self_len - start]) + block.call(string.byteslice(start, self_len - start)) self end