1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

matz: 1.6.0 final (hopufully)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2000-09-12 05:37:38 +00:00
parent 9d823983dc
commit fbcc6dea0c
20 changed files with 135 additions and 78 deletions

View file

@ -355,7 +355,10 @@ rb_ary_unshift_m(argc, argv, ary)
VALUE *argv;
VALUE ary;
{
if (argc > 0) {
if (argc == 0) {
rb_raise(rb_eArgError, "wrong # of arguments(at least 1)");
}
if (argc > 1) {
long len = RARRAY(ary)->len;
/* make rooms by setting the last item */
@ -363,7 +366,6 @@ rb_ary_unshift_m(argc, argv, ary)
/* sliding items */
MEMMOVE(RARRAY(ary)->ptr + argc, RARRAY(ary)->ptr, VALUE, len);
MEMCPY(RARRAY(ary)->ptr, argv, VALUE, argc);
}
return ary;