提交 bd5ed22c 编写于 作者: R Rich Felker

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.
上级 7211551e
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册