From 22ce9f81c335a81a3728ac4ef8faac965bc6fcbf Mon Sep 17 00:00:00 2001 From: akr Date: Thu, 10 Jun 2010 22:37:40 +0000 Subject: [PATCH] * time.c (find_time_t): test the result of LOCALTIME. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ time.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index fe298b4bed..55e8d97894 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Fri Jun 11 07:34:25 2010 Tanaka Akira + + * time.c (find_time_t): test the result of LOCALTIME. + Fri Jun 11 00:42:45 2010 Tanaka Akira * time.c (rb_localtime_r2): fix localtime overflow check. diff --git a/time.c b/time.c index 6c5a4f20d0..2623850efb 100644 --- a/time.c +++ b/time.c @@ -2870,7 +2870,7 @@ find_time_t(struct tm *tptr, int utc_p, time_t *tp) guess2 += 24 * 60 * 60; if (guess != guess2) { tm = LOCALTIME(&guess2, result); - if (tmcmp(tptr, tm) == 0) { + if (tm && tmcmp(tptr, tm) == 0) { if (guess < guess2) *tp = guess; else @@ -2895,7 +2895,7 @@ find_time_t(struct tm *tptr, int utc_p, time_t *tp) guess2 -= 24 * 60 * 60; if (guess != guess2) { tm = LOCALTIME(&guess2, result); - if (tmcmp(tptr, tm) == 0) { + if (tm && tmcmp(tptr, tm) == 0) { if (guess < guess2) *tp = guess2; else