summaryrefslogtreecommitdiffhomepage
path: root/mrblib
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2015-09-22 19:10:03 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2015-09-22 19:10:48 +0900
commit2cb6c2778134575e425cd5d1bdef036100a25d0d (patch)
tree29674e849669c4929afab4e0bd2eebfc5c0339d9 /mrblib
parente47f0fc0c2d23c8dbf196c8885d1c295c9150265 (diff)
downloadmruby-2cb6c2778134575e425cd5d1bdef036100a25d0d.tar.gz
mruby-2cb6c2778134575e425cd5d1bdef036100a25d0d.zip
String#index should no longer take integer argument
Diffstat (limited to 'mrblib')
-rw-r--r--mrblib/string.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/mrblib/string.rb b/mrblib/string.rb
index 5765cff9b..7209f03d2 100644
--- a/mrblib/string.rb
+++ b/mrblib/string.rb
@@ -12,7 +12,7 @@ class String
def each_line(&block)
# expect that str.index accepts an Integer for 1st argument as a byte data
offset = 0
- while pos = self.index(0x0a, offset)
+ while pos = self.index("\n", offset)
block.call(self[offset, pos + 1 - offset])
offset = pos + 1
end