diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-29 12:18:44 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-29 12:18:44 +0000 |
commit | 01d105e6864f804483d484f5368d0ffe5db6b969 (patch) | |
tree | b208518ea5d4ef10d2bc32a73fbac3abf3feea4e /array.c | |
parent | a4884edb1ebb409ff3508b95a56a92df8ce493df (diff) |
* array.c (rb_ary_fill): (compatibility) do not raise
ArgumentError on negative length. This behaviour shall change
in a future release.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@17711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -2272,6 +2272,9 @@ rb_ary_fill(argc, argv, ary) break; } rb_ary_modify(ary); + if (len < 0) { + return ary; + } if (len > ARY_MAX_SIZE - beg) { rb_raise(rb_eArgError, "argument too big"); } |