Our strptime(3) format string '%A' does not conform to Single UNIX
Specification v2, Solaris2, NetBSD, and maybe other implementation.
This comes from the changes of src/lib/libc/stdtime/strptime.c rev
1.13, which is commited by ache. Backout this changes (and apply to
4-stable) should fix the problem, but we also modify the manapage of
strptime(3) which isn't also conform to other spec/implementation.


Our strptime(3) implementation distinguishs '%A' and '%a', just like
strftime(3) does. However, the Single UNIX Specification v2 doesn't
say that '%A' and '%a' is different.

is a spec of strptime(3) of SUSv2. It says:

        %a is the day of week, using the locale's weekday names;
           either the abbreviated or full name may be specified.
        %A is the same as %a.

Note that strftime(3) specification says that '%'a and '%A' is different.

        %a is replaced by the locale's abbreviated weekday name.
        %A is replaced by the locale's full weekday name.

You can easily check that strptime(3) implementation of Solaris2 and
NetBSD are conformed to this standard. FreeBSD's implementation is
different from others.

I've asked via IRC, and told from eivind that this is because the
changes of src/lib/libc/stdtime/strptime.c rev 1.13 (by ache) causes
this misimplementation.


The commitlog apprantly say that he misunderstands that '%A' and '%a'
is different operation. But we cannot beat him, since our strptime(3) manpage,

     The format string consists of zero or more conversion
     specifications and ordinary characters.  All ordinary characters
     are matched exactly with the buffer, where white space in the
     format string will match any amount of white space in the buffer.
     All conversion specifications are identi- cal to those described
     in strftime(3).

It's true in the viewpoint of 'the manual should describe its
implementation', but completely wrong in the view point of SUSv2
specification and/or other implementations.

NetBSD, the one of implementation of strptime(3), have a correct
manpages of strptime(3):

So.. there are two bugs in our strptime(3):

- Our implementation of strptime(3) distingush '%A' and '%a'.
        We can  fix this with backouting rev 1.13. It can be easily
        MFCed to  4-stable.
- Our manpage of strptime(3) says its format string is the same of
        We can fix strptime(3) manpage, importing most of description
        from strftime(3) and modify it. We can also refer NetBSD's
        manpage to how to describe strptime(3).


Acknowledgement: This problem is first reported to japanaese list, by
Kojima-san (this is why I cc:-ed to him). We also says that without
this GNU wget does misunderstands Date: format defined by RFC850. If
you wanna check what he says first (and understand japanese), check

Kojima-san, can I describe all your problems?

-- -

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to