summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-06-01 09:38:30 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-06-01 09:38:30 +0000
commitab9b733259f4178308f813b0bd03d0afaeacce0c (patch)
tree6c35fd2857e3330eaba2c2dfec4645e35340924d /hash.c
parentd23012904ac77bff3d687e696fc00831546ac2fa (diff)
* hash.c (replace_i): ignore when key == Qundef.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/hash.c b/hash.c
index eb6e73908c..1b007526da 100644
--- a/hash.c
+++ b/hash.c
@@ -510,7 +510,10 @@ static int
replace_i(key, val, hash)
VALUE key, val, hash;
{
- rb_hash_aset(hash, key, val);
+ if (key != Qundef) {
+ rb_hash_aset(hash, key, val);
+ }
+
return ST_CONTINUE;
}