summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/hash.c b/hash.c
index 1bb4c93bf6..a2fa1fdcdf 100644
--- a/hash.c
+++ b/hash.c
@@ -1002,8 +1002,10 @@ static VALUE
env_delete_m(obj, name)
VALUE obj, name;
{
- VALUE val = env_delete(obj, name);
- if (rb_block_given_p()) rb_yield(name);
+ VALUE val;
+
+ val = env_delete(obj, name);
+ if (NIL_P(val) && rb_block_given_p()) rb_yield(name);
return val;
}
@@ -1342,6 +1344,7 @@ env_reject_bang()
VALUE val = rb_f_getenv(Qnil, *ptr);
if (!NIL_P(val)) {
if (RTEST(rb_yield(rb_assoc_new(*ptr, val)))) {
+ FL_UNSET(*ptr, FL_TAINT);
env_delete(Qnil, *ptr);
del++;
}