зеркало из https://github.com/github/ruby.git
* time.c (find_time_t): use mktime for the first guess.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
18b17dcd19
Коммит
44320bc32c
|
@ -1,3 +1,7 @@
|
|||
Sun Aug 30 23:44:09 2009 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* time.c (find_time_t): use mktime for the first guess.
|
||||
|
||||
Sun Aug 30 16:38:56 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* parse.y (rb_enc_symname2_p): not depend on nul terminator.
|
||||
|
|
10
time.c
10
time.c
|
@ -1962,6 +1962,16 @@ find_time_t(struct tm *tptr, int utc_p, time_t *tp)
|
|||
|
||||
find_dst = 0 < tptr->tm_isdst;
|
||||
|
||||
#if defined(HAVE_MKTIME)
|
||||
tm0 = *tptr;
|
||||
if (!utc_p && (guess = mktime(&tm0)) != -1) {
|
||||
tm = GUESS(&guess);
|
||||
if (tm && tmcmp(tptr, tm) == 0) {
|
||||
goto found;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
tm0 = *tptr;
|
||||
if (tm0.tm_mon < 0) {
|
||||
tm0.tm_mon = 0;
|
||||
|
|
Загрузка…
Ссылка в новой задаче