HomeFreeBSD

strptime: fix parsing of tm_year when both %C and %y appear in the

Description

strptime: fix parsing of tm_year when both %C and %y appear in the
format string in arbitrary order. This makes the related test cases in
lib/libc/tests/time (not yet connected to the build) pass.

While here, don't error on negative tm_year value based on the
APPLICATION USAGE in
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/time.h.html
(glibc does the same):

tm_year is a signed value; therefore, years before 1900 may be represented.

Approved by: re (gjb), kib (mentor)
Differential Revision: https://reviews.freebsd.org/D17550

Details

Provenance
yuripvAuthored on
Differential Revision
D17550: strptime: fix %C, %y, and %Y permutations
Parents
rS339407: The countp argument passed to linker_file_lookup_set() in
Branches
Unknown
Tags
Unknown