summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-06-13 03:55:44 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-06-13 03:55:44 +0000
commitb3ecbfaa01e7c75bfea9c895bb7476c58e998131 (patch)
tree1b23f1e6c0b8291136e64917835310a6cbde1fbc /hash.c
parenta2020f907a942f09c651b1006151c932cdf7e77e (diff)
* eval.c (svalue_to_avalue): v may be Qundef. This fix was
suggested by Guy Decoux. * hash.c (rb_hash_s_create): use rb_hash_aset() instead of calling st_insert() directly, to dup&freeze string keys. * parse.y (yylex): proper error message for "@@0". * parse.y (yylex): paren to parse_string() must be zero for unparenthesized strings. * parse.y (str_extend): broken string when unterminated "#{". * enum.c (enum_sort_by): had a bug in 1 element enumeration. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hash.c b/hash.c
index 43fbd28..5cc3638 100644
--- a/hash.c
+++ b/hash.c
@@ -240,7 +240,7 @@ rb_hash_s_create(argc, argv, klass)
hash = rb_hash_s_alloc(klass);
for (i=0; i<argc; i+=2) {
- st_insert(RHASH(hash)->tbl, argv[i], argv[i+1]);
+ rb_hash_aset(hash, argv[i], argv[i + 1]);
}
return hash;
@@ -314,7 +314,7 @@ rb_hash_fetch(argc, argv, hash)
if (!st_lookup(RHASH(hash)->tbl, key, &val)) {
if (rb_block_given_p()) {
if (argc > 1) {
- rb_raise(rb_eArgError, "wrong number of arguments", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments");
}
return rb_yield(key);
}