From owner-freebsd-stable Sat Mar 17 21:19:38 2001 Delivered-To: freebsd-stable@freebsd.org Received: from updraft.jp.freebsd.org (updraft.jp.FreeBSD.ORG [210.157.158.42]) by hub.freebsd.org (Postfix) with ESMTP id E0F1C37B719; Sat, 17 Mar 2001 21:19:29 -0800 (PST) (envelope-from matusita@jp.FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by updraft.jp.freebsd.org (8.11.3+3.4W/8.11.3) with ESMTP/inet id f2I5JOW79977; Sun, 18 Mar 2001 14:19:25 +0900 (JST) (envelope-from matusita@jp.FreeBSD.org) Cc: ache@freebsd.org, kjm@rins.ryukoku.ac.jp X-Face: '*aj"d@ijeQ:/X}]oM5c5Uz{ZZZk90WPt>a^y4$cGQp8:!H\W=hSM;PuNiidkc]/%,;6VGu e+`&APmz|P;F~OL/QK%;P2vU>\j4X.8@i%j6[%DTs_3J,Fff0)*oHg$A.cDm&jc#pD24WK@{,"Ef!0 P\):.2}8jo-BiZ?X&t$V X-User-Agent: Mew/1.94.2 XEmacs/21.2 (Poseidon) X-FaceAnim: (-O_O-)(O_O- )(_O- )(O- )(- -)( -O)( -O_)( -O_O)(-O_O-) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Dispatcher: imput version 20000228(IM140) Lines: 82 From: Makoto MATSUSHITA To: current@freebsd.org, stable@freebsd.org Subject: Our strptime(3) doesn't conform to other standards/implementations Date: Sun, 18 Mar 2001 14:19:13 +0900 Message-Id: <20010318141913L.matusita@jp.FreeBSD.org> Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Summary: 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. says: %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, says: 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 strftime(3). 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? -- - Makoto `MAR' MATSUSHITA To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message