From 4f38c453b4fccfbc529909781c2c1659f256697b Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 28 Jan 2002 08:44:45 +0000 Subject: * eval.c (is_defined): defined?(Foo::Baz) should check constants only, no methods. * eval.c (is_defined): should not dump core on defined?(a::b) where a is not a class nor a module. * object.c (Init_Object): remove dup and clone from TrueClass, FalseClass, and NilClass. * array.c (rb_ary_fill): Array#fill takes block to get the value to fill. * string.c (rb_str_to_i): to_i(0) auto-detects base radix. * array.c (rb_ary_initialize): fill by the block evaluation value if block is given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- hash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hash.c') diff --git a/hash.c b/hash.c index 0f91bc6b06..8234db2b25 100644 --- a/hash.c +++ b/hash.c @@ -201,8 +201,8 @@ rb_hash_initialize(argc, argv, hash) rb_hash_modify(hash); if (rb_block_given_p()) { - if (argc > 1) { - rb_raise(rb_eArgError, "wrong number of arguments", argc); + if (argc > 0) { + rb_raise(rb_eArgError, "wrong number of arguments"); } RHASH(hash)->ifnone = rb_f_lambda(); FL_SET(hash, HASH_PROC_DEFAULT); -- cgit v1.2.3