about summary refs log tree commit diff
path: root/src/time/__tz.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2013-08-23 23:07:09 -0400
committerRich Felker <dalias@aerifal.cx>2013-08-23 23:07:09 -0400
commitbd5ed22c58c1356f22fb69a8c392f650a0d89443 (patch)
tree4a5aa6bbddb7d68470a0bc8aa9aacc84120631c6 /src/time/__tz.c
parent7211551e9ff7c8c9d1491856088cf832f2722bd6 (diff)
downloadmusl-bd5ed22c58c1356f22fb69a8c392f650a0d89443.tar.gz
musl-bd5ed22c58c1356f22fb69a8c392f650a0d89443.tar.xz
musl-bd5ed22c58c1356f22fb69a8c392f650a0d89443.zip
fix mishandling of empty or blank TZ environment variable
the empty TZ string was matching equal to the initial value of the
cached TZ name, thus causing do_tzset never to run and never to
initialize the time zone data.
Diffstat (limited to 'src/time/__tz.c')
-rw-r--r--src/time/__tz.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/time/__tz.c b/src/time/__tz.c
index a76a7b48..36b59802 100644
--- a/src/time/__tz.c
+++ b/src/time/__tz.c
@@ -127,7 +127,7 @@ static void do_tzset()
 		"/usr/share/zoneinfo/\0/share/zoneinfo/\0/etc/zoneinfo/\0";
 
 	s = getenv("TZ");
-	if (!s) s = "";
+	if (!s || !*s) s = "GMT0";
 
 	if (old_tz && !strcmp(s, old_tz)) return;