From 2a780aa3050b86d888489361f04220bfb58890a1 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 6 Jul 2015 22:13:11 +0000 Subject: treat empty TZ environment variable as GMT rather than default this improves compatibility with the behavior of other systems and with some applications which set an empty TZ var to disable use of local time by mktime, etc. --- src/time/__tz.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/time/__tz.c b/src/time/__tz.c index 13cb1aed..102c8bc7 100644 --- a/src/time/__tz.c +++ b/src/time/__tz.c @@ -125,7 +125,8 @@ static void do_tzset() "/usr/share/zoneinfo/\0/share/zoneinfo/\0/etc/zoneinfo/\0"; s = getenv("TZ"); - if (!s || !*s) s = "/etc/localtime"; + if (!s) s = "/etc/localtime"; + if (!*s) s = __gmt; if (old_tz && !strcmp(s, old_tz)) return; -- cgit v1.2.1