renamed ruby_tz_update as ruby_tz_uptodate_p

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-07-19 11:22:03 +00:00
Родитель 1adbbc3f48
Коммит 5ad205b81d
2 изменённых файлов: 6 добавлений и 6 удалений

6
hash.c
Просмотреть файл

@ -3316,7 +3316,7 @@ env_str_new2(const char *ptr)
static int env_path_tainted(const char *); static int env_path_tainted(const char *);
static const char TZ_ENV[] = "TZ"; static const char TZ_ENV[] = "TZ";
extern int ruby_tz_update; extern bool ruby_tz_uptodate_p;
static rb_encoding * static rb_encoding *
env_encoding_for(const char *name, const char *ptr) env_encoding_for(const char *name, const char *ptr)
@ -3400,7 +3400,7 @@ env_delete(VALUE obj, VALUE name)
path_tainted = 0; path_tainted = 0;
} }
else if (ENVMATCH(nam, TZ_ENV)) { else if (ENVMATCH(nam, TZ_ENV)) {
ruby_tz_update = 0; ruby_tz_uptodate_p = FALSE;
} }
return value; return value;
} }
@ -3762,7 +3762,7 @@ env_aset(VALUE obj, VALUE nm, VALUE val)
} }
} }
else if (ENVMATCH(name, TZ_ENV)) { else if (ENVMATCH(name, TZ_ENV)) {
ruby_tz_update = 0; ruby_tz_uptodate_p = FALSE;
} }
return val; return val;
} }

6
time.c
Просмотреть файл

@ -647,7 +647,7 @@ static struct vtm *localtimew(wideval_t timew, struct vtm *result);
static int leap_year_p(long y); static int leap_year_p(long y);
#define leap_year_v_p(y) leap_year_p(NUM2LONG(modv((y), INT2FIX(400)))) #define leap_year_v_p(y) leap_year_p(NUM2LONG(modv((y), INT2FIX(400))))
int ruby_tz_update; bool ruby_tz_uptodate_p;
static struct tm * static struct tm *
rb_localtime_r(const time_t *t, struct tm *result) rb_localtime_r(const time_t *t, struct tm *result)
@ -655,8 +655,8 @@ rb_localtime_r(const time_t *t, struct tm *result)
#if defined __APPLE__ && defined __LP64__ #if defined __APPLE__ && defined __LP64__
if (*t != (time_t)(int)*t) return NULL; if (*t != (time_t)(int)*t) return NULL;
#endif #endif
if (!ruby_tz_update) { if (!ruby_tz_uptodate_p) {
ruby_tz_update = 1; ruby_tz_uptodate_p = 1;
tzset(); tzset();
} }
#ifdef HAVE_GMTIME_R #ifdef HAVE_GMTIME_R