* libc/time/strptime.c (first_day): Actually return the wday

of the first day of the year.
This commit is contained in:
Corinna Vinschen 2011-05-12 12:43:43 +00:00
parent 205b82080b
commit 7bb76e751b
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2011-05-12 Peter Rosin <peda@lysator.liu.se>
* libc/time/strptime.c (first_day): Actually return the wday
of the first day of the year.
2011-05-10 Corinna Vinschen <vinschen@redhat.com> 2011-05-10 Corinna Vinschen <vinschen@redhat.com>
* libc/locale/lmessages.c (_C_messages_locale): Add missing comma. * libc/locale/lmessages.c (_C_messages_locale): Add missing comma.

View File

@ -78,8 +78,8 @@ first_day (int year)
{ {
int ret = 4; int ret = 4;
for (; year > 1970; --year) while (--year >= 1970)
ret = (ret + 365 + is_leap_year (year) ? 1 : 0) % 7; ret = (ret + 365 + is_leap_year (year)) % 7;
return ret; return ret;
} }