diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-06-10 22:37:40 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-06-10 22:37:40 +0000 |
commit | 22ce9f81c335a81a3728ac4ef8faac965bc6fcbf (patch) | |
tree | ddbc1b1851d2783869fbaccfef62ec394e8ce145 /time.c | |
parent | cb962c5ae59f9237038d6400d9c1e709bed80efd (diff) | |
download | ruby-22ce9f81c335a81a3728ac4ef8faac965bc6fcbf.tar.gz |
* 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
Diffstat (limited to 'time.c')
-rw-r--r-- | time.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 |