summaryrefslogtreecommitdiff
path: root/time.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-09 11:33:46 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-09 11:33:46 +0000
commit00f97ed41a56f8146a8066db0934b574615b9760 (patch)
treedf09566408ce070dc24021c320008928db5e3c63 /time.c
parent4eec1b31b90f89101a482600770df1faae041a13 (diff)
* time.c (find_time_t): 24:00 should be the beginning of the next
day even if the leap second, 23:59:60, exists. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'time.c')
-rw-r--r--time.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/time.c b/time.c
index 04145f63ea..d2a90d4aa2 100644
--- a/time.c
+++ b/time.c
@@ -2928,6 +2928,7 @@ find_time_t(struct tm *tptr, int utc_p, time_t *tp)
return NULL;
}
}
+
/* Given argument has no corresponding time_t. Let's outerpolation. */
/*
* `Seconds Since the Epoch' in SUSv3:
@@ -2950,7 +2951,7 @@ find_time_t(struct tm *tptr, int utc_p, time_t *tp)
tm_lo.tm_yday) * 86400 +
(tptr->tm_hour - tm_lo.tm_hour) * 3600 +
(tptr->tm_min - tm_lo.tm_min) * 60 +
- (tptr->tm_sec - tm_lo.tm_sec);
+ (tptr->tm_sec - (tm_lo.tm_sec == 60 ? 59 : tm_lo.tm_sec));
return NULL;