From 08529a61153e5c40f57a65272211357511d6e6db Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 18 Apr 2020 20:39:07 +0900 Subject: [PATCH] Compare environment variable names in those manor [Bug #16798] --- hash.c | 22 +++++++++++++++++++--- test/ruby/test_env.rb | 2 ++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/hash.c b/hash.c index 769af0df7d..71bbfea4a0 100644 --- a/hash.c +++ b/hash.c @@ -6343,13 +6343,29 @@ env_invert(VALUE _) return rb_hash_invert(env_to_hash()); } +static void +keylist_delete(VALUE keys, VALUE key) +{ + long keylen, elen; + const char *keyptr, *eptr; + RSTRING_GETMEM(key, keyptr, keylen); + for (long i=0; i"bar", "baz"=>"qux"}) check(ENV.to_hash.to_a, [%w(foo bar), %w(baz qux)]) + ENV.replace({"Foo"=>"Bar", "Baz"=>"Qux"}) + check(ENV.to_hash.to_a, [%w(Foo Bar), %w(Baz Qux)]) end def test_update