1
0
Эх сурвалжийг харах

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.
Rich Felker 9 жил өмнө
parent
commit
2a780aa305
1 өөрчлөгдсөн 2 нэмэгдсэн , 1 устгасан
  1. 2 1
      src/time/__tz.c

+ 2 - 1
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;