diff --git a/ChangeLog b/ChangeLog index 8a715ee813..1414882de1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed May 1 21:11:17 2013 Tanaka Akira + + * time.c (localtime_with_gmtoff_zone): musl libc may return NULL for + tm_zone. + Wed May 1 18:59:36 2013 Benoit Daloze * enum.c (Enumerable#chunk): fix grammar of error message diff --git a/time.c b/time.c index e9f59c7353..6b457f22ff 100644 --- a/time.c +++ b/time.c @@ -1697,7 +1697,10 @@ localtime_with_gmtoff_zone(const time_t *t, struct tm *result, long *gmtoff, con if (zone) { #if defined(HAVE_TM_ZONE) - *zone = zone_str(tm.tm_zone); + if (tm.tm_zone) + *zone = zone_str(tm.tm_zone); + else + *zone = zone_str("(NO-TIMEZONE-ABBREVIATION)"); #elif defined(HAVE_TZNAME) && defined(HAVE_DAYLIGHT) /* this needs tzset or localtime, instead of localtime_r */ *zone = zone_str(tzname[daylight && tm.tm_isdst]);