strftime %W patch

J. Johnston jjohnstn@cygnus.com
Thu Sep 13 13:50:00 GMT 2001


Jason Tishler wrote:
> 
> [Please CC me on replies since I am not subscribed to this list.]
> 
> While tracking down why Cygwin Python's strftime regression test
> failed, I uncovered a problem with the current newlib strftime() "%W"
> implementation.  It seems just like people, newlib's strftime() does
> not like Mondays. :,)
> 

Patch checked in - thanks.

-- Jeff J.

> The first attachment is a small test program that demonstrates the
> problem.
> 
> When run under Cygwin, we get the following:
> 
>     $ stest2
>     37
>     Mon Sep 17 16:13:02 2001
> 
> but when run under Red Hat 7.1, we get the following:
> 
>     $ stest2
>     38
>     Mon Sep 17 16:13:02 2001
> 
> as expected.
> 
> The second and third attachments are a patch and corresponding ChangeLog
> that correct this problem.  Since newlib's strftime() "%U" behaved
> correctly, I modeled the "%W" implementation after it.
> 
> After applying this patch, both the test program and Python's strftime
> regression test ran correctly.
> 
> Thanks,
> Jason
> 
>   ----------------------------------------------------------------------------------------------------
> 
>    stest2.cName: stest2.c
>            Type: Plain Text (text/plain)
> 
>    strftime.c.diffName: strftime.c.diff
>                   Type: Plain Text (text/plain)
> 
>    strftime.c.ChangeLogName: strftime.c.ChangeLog
>                        Type: Plain Text (text/plain)



More information about the Newlib mailing list