[前][次][番号順一覧][スレッド一覧]

ruby-changes:28488

From: akr <ko1@a...>
Date: Wed, 1 May 2013 21:12:40 +0900 (JST)
Subject: [ruby-changes:28488] akr:r40540 (trunk): * time.c (localtime_with_gmtoff_zone): musl libc may return NULL for

akr	2013-05-01 21:12:25 +0900 (Wed, 01 May 2013)

  New Revision: 40540

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40540

  Log:
    * time.c (localtime_with_gmtoff_zone): musl libc may return NULL for
      tm_zone.

  Modified files:
    trunk/ChangeLog
    trunk/time.c

Index: time.c
===================================================================
--- time.c	(revision 40539)
+++ time.c	(revision 40540)
@@ -1697,7 +1697,10 @@ localtime_with_gmtoff_zone(const time_t https://github.com/ruby/ruby/blob/trunk/time.c#L1697
 
         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]);
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 40539)
+++ ChangeLog	(revision 40540)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed May  1 21:11:17 2013  Tanaka Akira  <akr@f...>
+
+	* time.c (localtime_with_gmtoff_zone): musl libc may return NULL for
+	  tm_zone.
+
 Wed May  1 18:59:36 2013  Benoit Daloze  <eregontp@g...>
 
 	* enum.c (Enumerable#chunk): fix grammar of error message

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]