diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-06-19 19:17:24 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-06-19 19:17:24 +0900 |
| commit | 49ecd44c7be9dccca40172bc6a3d3fb2d97689e3 (patch) | |
| tree | 87e33b17c5ddc793d079d5c3d77fc10021658fcc /mrbgems/mruby-string-ext/mrblib/string.rb | |
| parent | ba0ddb78199dca7e58e4f0fb3982e52059242900 (diff) | |
| parent | ec04fa7e8d60971fb4b51255c6e84a81f87a0593 (diff) | |
| download | mruby-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.rb | 2 |
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 |
