From: Rich Felker Date: Mon, 6 Jul 2015 22:13:11 +0000 (+0000) Subject: treat empty TZ environment variable as GMT rather than default X-Git-Tag: v1.1.11~21 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2a780aa3050b86d888489361f04220bfb58890a1;p=oweals%2Fmusl.git 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. --- 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;