[PATCH 04/59] Don't worry about !TZDEFAULT
Paul Eggert
eggert@cs.ucla.edu
Sun Jan 5 05:56:39 GMT 2025
* time/tzset.c (tzset_internal): Simplify due to the fact that
TZDEFAULT is not a null pointer (tzfile.c is already assuming this).
---
time/tzset.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/time/tzset.c b/time/tzset.c
index e178742222..1a9a03a436 100644
--- a/time/tzset.c
+++ b/time/tzset.c
@@ -384,17 +384,17 @@ tzset_internal (int always)
/* Save the value of `tz'. */
free (old_tz);
- old_tz = tz ? __strdup (tz) : NULL;
+ old_tz = __strdup (tz);
/* Try to read a data file. */
__tzfile_read (tz);
if (__use_tzfile)
return;
- /* No data file found. Default to UTC if nothing specified. */
+ /* No data file found. Default to UTC if nothing specified or if
+ TZDEFAULT is broken. */
- if (tz == NULL || *tz == '\0'
- || (TZDEFAULT != NULL && strcmp (tz, TZDEFAULT) == 0))
+ if (*tz == '\0' || strcmp (tz, TZDEFAULT) == 0)
{
memset (tz_rules, '\0', sizeof tz_rules);
tz_rules[0].name = tz_rules[1].name = "UTC";
--
2.45.2
More information about the Libc-alpha
mailing list