* array.c (rb_ary_unshift_m): need to check number of arguments.
[ruby-talk:74189] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9d05b9a4b3
commit
d749616333
@ -1,3 +1,8 @@
|
|||||||
|
Tue Jun 24 02:40:09 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
|
* array.c (rb_ary_unshift_m): need to check number of arguments.
|
||||||
|
[ruby-talk:74189]
|
||||||
|
|
||||||
Mon Jun 23 23:59:56 2003 Minero Aoki <aamine@loveruby.net>
|
Mon Jun 23 23:59:56 2003 Minero Aoki <aamine@loveruby.net>
|
||||||
|
|
||||||
* io.c (io_close): missing prototype.
|
* io.c (io_close): missing prototype.
|
||||||
|
7
array.c
7
array.c
@ -427,7 +427,12 @@ rb_ary_unshift_m(argc, argv, ary)
|
|||||||
VALUE ary;
|
VALUE ary;
|
||||||
{
|
{
|
||||||
long len = RARRAY(ary)->len;
|
long len = RARRAY(ary)->len;
|
||||||
|
|
||||||
|
if (argc < 0) {
|
||||||
|
rb_raise(rb_eArgError, "negative number of arguments");
|
||||||
|
}
|
||||||
|
if (argc == 0) return ary;
|
||||||
|
|
||||||
/* make rooms by setting the last item */
|
/* make rooms by setting the last item */
|
||||||
rb_ary_store(ary, len + argc - 1, Qnil);
|
rb_ary_store(ary, len + argc - 1, Qnil);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user