зеркало из https://github.com/github/ruby.git
Hoisted out reset_by_modified_env
This commit is contained in:
Родитель
67e4d5e623
Коммит
ec4e57cae0
22
hash.c
22
hash.c
|
@ -4881,14 +4881,9 @@ env_name(volatile VALUE *s)
|
||||||
|
|
||||||
static VALUE env_aset(VALUE nm, VALUE val);
|
static VALUE env_aset(VALUE nm, VALUE val);
|
||||||
|
|
||||||
static VALUE
|
static void
|
||||||
env_delete(VALUE name)
|
reset_by_modified_env(const char *nam)
|
||||||
{
|
{
|
||||||
const char *nam, *val;
|
|
||||||
|
|
||||||
nam = env_name(name);
|
|
||||||
val = getenv(nam);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ENV['TZ'] = nil has a special meaning.
|
* ENV['TZ'] = nil has a special meaning.
|
||||||
* TZ is no longer considered up-to-date and ruby call tzset() as needed.
|
* TZ is no longer considered up-to-date and ruby call tzset() as needed.
|
||||||
|
@ -4898,6 +4893,15 @@ env_delete(VALUE name)
|
||||||
if (ENVMATCH(nam, TZ_ENV)) {
|
if (ENVMATCH(nam, TZ_ENV)) {
|
||||||
ruby_reset_timezone();
|
ruby_reset_timezone();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static VALUE
|
||||||
|
env_delete(VALUE name)
|
||||||
|
{
|
||||||
|
const char *nam = env_name(name);
|
||||||
|
const char *val = getenv(nam);
|
||||||
|
|
||||||
|
reset_by_modified_env(nam);
|
||||||
|
|
||||||
if (val) {
|
if (val) {
|
||||||
VALUE value = env_str_new2(val);
|
VALUE value = env_str_new2(val);
|
||||||
|
@ -5327,9 +5331,7 @@ env_aset(VALUE nm, VALUE val)
|
||||||
if (ENVMATCH(name, PATH_ENV)) {
|
if (ENVMATCH(name, PATH_ENV)) {
|
||||||
RB_GC_GUARD(nm);
|
RB_GC_GUARD(nm);
|
||||||
}
|
}
|
||||||
else if (ENVMATCH(name, TZ_ENV)) {
|
reset_by_modified_env(name);
|
||||||
ruby_reset_timezone();
|
|
||||||
}
|
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче