diff options
author | Rich Felker <dalias@aerifal.cx> | 2015-07-06 22:13:11 +0000 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2015-07-06 22:13:11 +0000 |
commit | 2a780aa3050b86d888489361f04220bfb58890a1 (patch) | |
tree | 44106ec5c29eb2c7e5d38a15614534cacb048c31 /src/time | |
parent | 8f08a58c635bea5cdfae6bc0e323c80aa9ff82a7 (diff) | |
download | musl-2a780aa3050b86d888489361f04220bfb58890a1.tar.gz musl-2a780aa3050b86d888489361f04220bfb58890a1.tar.xz musl-2a780aa3050b86d888489361f04220bfb58890a1.zip |
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.
Diffstat (limited to 'src/time')
-rw-r--r-- | src/time/__tz.c | 3 |
1 files changed, 2 insertions, 1 deletions
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; |