From: Corinna Vinschen Date: Thu, 12 May 2011 12:43:43 +0000 (+0000) Subject: * libc/time/strptime.c (first_day): Actually return the wday X-Git-Tag: sid-snapshot-20110601~81 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=7bb76e751b1df7b8d0a7527197540a0a26071758;p=newlib-cygwin.git * libc/time/strptime.c (first_day): Actually return the wday of the first day of the year. --- diff --git a/newlib/ChangeLog b/newlib/ChangeLog index b6d83872a..fe8bd88ca 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,8 @@ +2011-05-12 Peter Rosin + + * libc/time/strptime.c (first_day): Actually return the wday + of the first day of the year. + 2011-05-10 Corinna Vinschen * libc/locale/lmessages.c (_C_messages_locale): Add missing comma. diff --git a/newlib/libc/time/strptime.c b/newlib/libc/time/strptime.c index 1457c93ed..bc16fa5eb 100644 --- a/newlib/libc/time/strptime.c +++ b/newlib/libc/time/strptime.c @@ -78,8 +78,8 @@ first_day (int year) { int ret = 4; - for (; year > 1970; --year) - ret = (ret + 365 + is_leap_year (year) ? 1 : 0) % 7; + while (--year >= 1970) + ret = (ret + 365 + is_leap_year (year)) % 7; return ret; }