From owner-freebsd-bugs@FreeBSD.ORG Tue Aug 25 17:20:02 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C28B106568F for ; Tue, 25 Aug 2009 17:20:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 7A27C8FC26 for ; Tue, 25 Aug 2009 17:20:02 +0000 (UTC) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n7PHK28j023550 for ; Tue, 25 Aug 2009 17:20:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n7PHK2XJ023549; Tue, 25 Aug 2009 17:20:02 GMT (envelope-from gnats) Date: Tue, 25 Aug 2009 17:20:02 GMT Message-Id: <200908251720.n7PHK2XJ023549@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: "Green, Paul" Cc: Subject: Re: kern/137307: [libc] [patch] Enhance strptime(3) to support %U and %W X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: "Green, Paul" List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2009 17:20:02 -0000 The following reply was made to PR kern/137307; it has been noted by GNATS. From: "Green, Paul" To: Cc: "Green, Paul" Subject: Re: kern/137307: [libc] [patch] Enhance strptime(3) to support %U and %W Date: Tue, 25 Aug 2009 12:33:21 -0400 This is a multi-part message in MIME format. ------_=_NextPart_001_01CA25A1.C230115A Content-Type: multipart/alternative; boundary="----_=_NextPart_002_01CA25A1.C230115A" ------_=_NextPart_002_01CA25A1.C230115A Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable This is a follow-up to problem report kern/137307 regarding proposed changes to the strptime function. Shortly after I submitted the report, I discovered that I had submitted the old version of the t_strptime.c test program. The version that I submitted is coded with the assumption that the tm_yday member of "struct tm" is 1-origin. In fact, it is 0-origin. The modified code for strptime.c that I submitted is correct; only the test case was wrong. This new version of t_strptime.c also adds some guards so that the tests for %U and %W are not normally compiled; you must change the value of the ALLOW_UW_TESTS macro from 0 to 1 to run them. This makes it easier to run the tests on a system that doesn't implement the new features. I have attached a uni-diff that corrects t_strptime.c. I apologize for my mistake. Thanks PG <>=20 ------_=_NextPart_002_01CA25A1.C230115A Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Re: kern/137307: [libc] [patch] Enhance strptime(3) to support %U = and %W

This is a follow-up to problem report = kern/137307 regarding proposed changes to the strptime function.

Shortly after I submitted the report, I = discovered that I had submitted the old version of the t_strptime.c test = program.  The version that I submitted is coded with the assumption = that the tm_yday member of "struct tm" is 1-origin.  In = fact, it is 0-origin.  The modified code for strptime.c that I = submitted is correct; only the test case was wrong.

This new version of t_strptime.c also = adds some guards so that the tests for %U and %W are not normally = compiled; you must change the value of the ALLOW_UW_TESTS macro from 0 = to 1 to run them.  This makes it easier to run the tests on a = system that doesn't implement the new features.

I have attached a uni-diff that = corrects t_strptime.c.

I apologize for my mistake.

Thanks
PG
= <<t_strptime.diff.txt>>

------_=_NextPart_002_01CA25A1.C230115A-- ------_=_NextPart_001_01CA25A1.C230115A Content-Type: text/plain; name="t_strptime.diff.txt" Content-Transfer-Encoding: base64 Content-Description: t_strptime.diff.txt Content-Disposition: attachment; filename="t_strptime.diff.txt" LS0tIHRfc3RycHRpbWUuYmFkLmMJMjAwOS0wNy0zMCAxNjoyODoyMC4wMDAwMDAwMDAgLTA0MDAK KysrIHRfc3RycHRpbWUuYwkyMDA5LTA4LTI1IDEyOjE5OjIxLjAwMDAwMDAwMCAtMDQwMApAQCAt MTEsNiArMTEsMTAgQEAKICNpbmNs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