ruby-changes:60828
From: Nobuyoshi <ko1@a...>
Date: Sun, 19 Apr 2020 00:35:20 +0900 (JST)
Subject: [ruby-changes:60828] 0a986b81e1 (master): Env values removed by ENV.clear are not used
https://git.ruby-lang.org/ruby.git/commit/?id=0a986b81e1 From 0a986b81e18bc3b4ed2a62b3679806194a49c0f3 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sat, 18 Apr 2020 21:30:53 +0900 Subject: Env values removed by ENV.clear are not used diff --git a/hash.c b/hash.c index 36b595b..e0f827b 100644 --- a/hash.c +++ b/hash.c @@ -5826,10 +5826,9 @@ rb_env_clear(void) https://github.com/ruby/ruby/blob/trunk/hash.c#L5826 keys = env_keys(TRUE); for (i=0; i<RARRAY_LEN(keys); i++) { - VALUE val = rb_f_getenv(Qnil, RARRAY_AREF(keys, i)); - if (!NIL_P(val)) { - env_delete(RARRAY_AREF(keys, i)); - } + VALUE key = RARRAY_AREF(keys, i); + const char *nam = RSTRING_PTR(key); + ruby_setenv(nam, 0); } RB_GC_GUARD(keys); return envtbl; -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/