summaryrefslogtreecommitdiff
path: root/time.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-01 12:12:25 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-01 12:12:25 +0000
commita4460ddb484979df59a1ff813c32cdf0861821d6 (patch)
tree2fbe99e7f8d0d32d2bc04fc73371cc45e35804e9 /time.c
parentbd14f5bf948d09497c8cad94164f472bbbe94db1 (diff)
* time.c (localtime_with_gmtoff_zone): musl libc may return NULL for
tm_zone. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'time.c')
-rw-r--r--time.c5
1 files changed, 4 insertions, 1 deletions
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]);