projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8f08a58
)
treat empty TZ environment variable as GMT rather than default
author
Rich Felker
<dalias@aerifal.cx>
Mon, 6 Jul 2015 22:13:11 +0000
(22:13 +0000)
committer
Rich Felker
<dalias@aerifal.cx>
Mon, 6 Jul 2015 22:13:11 +0000
(22:13 +0000)
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
patch
|
blob
|
history
diff --git
a/src/time/__tz.c
b/src/time/__tz.c
index 13cb1aedf9f9b1c1a5539219141c7871714b84f1..102c8bc764e1391720c3a341b8d3143c0d69bbee 100644
(file)
--- 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;