summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-string-ext/mrblib/string.rb
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-06-19 19:17:24 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-06-19 19:17:24 +0900
commit49ecd44c7be9dccca40172bc6a3d3fb2d97689e3 (patch)
tree87e33b17c5ddc793d079d5c3d77fc10021658fcc /mrbgems/mruby-string-ext/mrblib/string.rb
parentba0ddb78199dca7e58e4f0fb3982e52059242900 (diff)
parentec04fa7e8d60971fb4b51255c6e84a81f87a0593 (diff)
downloadmruby-49ecd44c7be9dccca40172bc6a3d3fb2d97689e3.tar.gz
mruby-49ecd44c7be9dccca40172bc6a3d3fb2d97689e3.zip
Merge pull request #2406 from iij/pr_string_slice_bang
Adapt a behavior of String#slice! to other Ruby implementations
Diffstat (limited to 'mrbgems/mruby-string-ext/mrblib/string.rb')
-rw-r--r--mrbgems/mruby-string-ext/mrblib/string.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/mrbgems/mruby-string-ext/mrblib/string.rb b/mrbgems/mruby-string-ext/mrblib/string.rb
index 1acdf150f..b8cb93199 100644
--- a/mrbgems/mruby-string-ext/mrblib/string.rb
+++ b/mrbgems/mruby-string-ext/mrblib/string.rb
@@ -169,7 +169,7 @@ class String
if arg1 != nil && arg2 != nil
idx = arg1
idx += self.size if arg1 < 0
- if idx >= 0 && idx < self.size && arg2 > 0
+ if idx >= 0 && idx <= self.size && arg2 > 0
str = self[idx, arg2]
else
return nil