about summary refs log tree commit diff
path: root/time/tzset.c
diff options
context:
space:
mode:
Diffstat (limited to 'time/tzset.c')
-rw-r--r--time/tzset.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/time/tzset.c b/time/tzset.c
index 2274a38f59..aa866918e5 100644
--- a/time/tzset.c
+++ b/time/tzset.c
@@ -159,10 +159,7 @@ tzset_internal (always)
 
   /* Examine the TZ environment variable.  */
   tz = getenv ("TZ");
-  if (tz == NULL)
-    /* No user specification; use the site-wide default.  */
-    tz = TZDEFAULT;
-  else if (*tz == '\0')
+  if (tz && *tz == '\0')
     /* User specified the empty string; use UTC explicitly.  */
     tz = "Universal";
 
@@ -177,6 +174,10 @@ tzset_internal (always)
     /* No change, simply return.  */
     return;
 
+  if (tz == NULL)
+    /* No user specification; use the site-wide default.  */
+    tz = TZDEFAULT;
+
   tz_rules[0].name = NULL;
   tz_rules[1].name = NULL;