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

ruby-changes:71292

From: Nobuyoshi <ko1@a...>
Date: Mon, 28 Feb 2022 13:30:06 +0900 (JST)
Subject: [ruby-changes:71292] 32f356e84a (master): Fix a typo of macro name

https://git.ruby-lang.org/ruby.git/commit/?id=32f356e84a

From 32f356e84a2079b1a68b056b5b150eb80928b185 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Mon, 28 Feb 2022 12:53:16 +0900
Subject: Fix a typo of macro name

When the date is 28 Feb in the local timezone and 27 in the UTC,
the leap second info is wrongly calculated, and the Time for 1 Mar
created with a timezone resulted in an invalid date, 30 Feb.
---
 time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/time.c b/time.c
index 3a004f8763..e7faef6df6 100644
--- a/time.c
+++ b/time.c
@@ -1110,7 +1110,7 @@ gmtime_with_leapsecond(const time_t *timep, struct tm *result) https://github.com/ruby/ruby/blob/trunk/time.c#L1110
                 result->tm_yday = leap_year_p(result->tm_year + 1900) ? 365 : 364;
             }
             else if (result->tm_mday == 1) {
-                const int8_t *days_in_month = days_in_month_of(result->tm_year + 1900);
+                const int8_t *days_in_month = days_in_month_in(result->tm_year + 1900);
                 result->tm_mon--;
                 result->tm_mday = days_in_month[result->tm_mon];
                 result->tm_yday--;
-- 
cgit v1.2.1


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

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