Thu Sep 13 08:49:49 2001 Jason Tishler <jason@tishler.net>

* strftime.c (strftime): Fix "%W" implementation to properly handle
        Mondays too.
This commit is contained in:
Jeff Johnston 2001-09-13 20:40:49 +00:00
parent 3900c377d8
commit 6342caa4e6
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,8 @@
Thu Sep 13 08:49:49 2001 Jason Tishler <jason@tishler.net>
* strftime.c (strftime): Fix "%W" implementation to properly handle
Mondays too.
2001-09-07 Jeff Law <law@redhat.com>
* libc/sys/h8300hms/crt0.S: For H8/300H and H8/S, load address of

View File

@ -362,9 +362,10 @@ _DEFUN (strftime, (s, maxsize, format, tim_p),
case 'W':
if (count < maxsize - 2)
{
int wday = (tim_p->tm_wday) ? tim_p->tm_wday - 1 : 6;
sprintf (&s[count], "%2.2d",
(tim_p->tm_yday + ((8 -
tim_p->tm_wday) % 7)) / 7);
(tim_p->tm_yday + 7 -
wday) / 7);
count += 2;
}
else