mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* array.c (rb_ary_slice_bang): should return nil if position out
of range. a patch from Akinori MUSHA <knu AT iDaemons.org>. [ruby-dev:32518] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f6a9c859be
commit
d04f108952
2 changed files with 7 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Mon Dec 10 21:00:30 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* array.c (rb_ary_slice_bang): should return nil if position out
|
||||||
|
of range. a patch from Akinori MUSHA <knu AT iDaemons.org>.
|
||||||
|
[ruby-dev:32518]
|
||||||
|
|
||||||
Mon Dec 10 19:02:52 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Mon Dec 10 19:02:52 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* re.c (rb_reg_match): should calculate offset by converted
|
* re.c (rb_reg_match): should calculate offset by converted
|
||||||
|
|
1
array.c
1
array.c
|
@ -1888,6 +1888,7 @@ rb_ary_slice_bang(int argc, VALUE *argv, VALUE ary)
|
||||||
delete_pos_len:
|
delete_pos_len:
|
||||||
if (pos < 0) {
|
if (pos < 0) {
|
||||||
pos = RARRAY_LEN(ary) + pos;
|
pos = RARRAY_LEN(ary) + pos;
|
||||||
|
if (pos < 0) return Qnil;
|
||||||
}
|
}
|
||||||
arg2 = rb_ary_subseq(ary, pos, len);
|
arg2 = rb_ary_subseq(ary, pos, len);
|
||||||
rb_ary_splice(ary, pos, len, Qundef); /* Qnil/rb_ary_new2(0) */
|
rb_ary_splice(ary, pos, len, Qundef); /* Qnil/rb_ary_new2(0) */
|
||||||
|
|
Loading…
Add table
Reference in a new issue