From owner-freebsd-bugs Fri Mar 7 5:10:18 2003 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 08B2337B401 for ; Fri, 7 Mar 2003 05:10:17 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3394143FAF for ; Fri, 7 Mar 2003 05:10:16 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h27DAFNS016957 for ; Fri, 7 Mar 2003 05:10:15 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h27DAFj9016956; Fri, 7 Mar 2003 05:10:15 -0800 (PST) Date: Fri, 7 Mar 2003 05:10:15 -0800 (PST) Message-Id: <200303071310.h27DAFj9016956@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Mike Makonnen Subject: Re: misc/48993: strptime() does not fill in some fields of struct tm Reply-To: Mike Makonnen Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR misc/48993; it has been noted by GNATS. From: Mike Makonnen To: "Nick Triantos" Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: misc/48993: strptime() does not fill in some fields of struct tm Date: Fri, 7 Mar 2003 08:08:19 -0500 Well, the man page says: If the format string does not contain enough conversion specifications to completely specify the resulting struct tm, the unspecified members of timeptr are left untouched. For example, if format is ``%H:%M:%S'', only tm_hour, tm_sec and tm_min will be modified. If time relative to today is desired, initialize the timeptr structure with today's date before passing it to strptime(). This is a clear contradiction with the actual code since, if the %s or %Z specifiers are used then GMT processing is assumed (unconditionaly for the first and conditional upon a GMT string in the second case) and the rest of the fields are filled in. This does not occur if a non-GMT time is used. This strikes me as inconsistent. Either the rest of the fields should be unconditionaly filled in or not. Your suggestion seems reasonable, but I don't know if there are any Standards issues involved. I'll supply a patch to freebsd-standards, and if no one objects, commit it. Cheers -- Mike Makonnen | GPG-KEY: http://www.identd.net/~mtm/mtm.asc mtm@identd.net | Fingerprint: D228 1A6F C64E 120A A1C9 A3AA DAE1 E2AF DBCC 68B9 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message