From owner-freebsd-bugs@FreeBSD.ORG Tue Jul 22 21:53:44 2014 Return-Path: Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 48D9087D for ; Tue, 22 Jul 2014 21:53:44 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16B5D2B28 for ; Tue, 22 Jul 2014 21:53:44 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MLrhui046460 for ; Tue, 22 Jul 2014 21:53:43 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 137307] [libc] [patch] Enhance strptime(3) to support %U and %W Date: Tue, 22 Jul 2014 21:53:44 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: pfg@FreeBSD.org X-Bugzilla-Status: In Discussion X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 21:53:44 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=137307 --- Comment #2 from Pedro F. Giffuni --- (In reply to Pedro F. Giffuni from comment #1) ... > I haven't tested it yet but I will. > Running test from: http://www.scs.stanford.edu/histar/src/pkg/uclibc/test/time/tst-strptime.c Results before the patch: ... strptime ("2001 20 Mon", "%Y %U %a", ...) should be: wday = 1, yday = 140, mon = 4, mday = 21 is: wday = 1, yday = 0, mon = 0, mday = 0 yearday for `2001 20 Mon' incorrect: 0 instead of 140 month for `2001 20 Mon' incorrect: 0 instead of 4 monthday for `2001 20 Mon' incorrect: 0 instead of 21 strptime ("2001 21 Mon", "%Y %W %a", ...) should be: wday = 1, yday = 140, mon = 4, mday = 21 is: wday = 1, yday = 0, mon = 0, mday = 0 yearday for `2001 21 Mon' incorrect: 0 instead of 140 month for `2001 21 Mon' incorrect: 0 instead of 4 monthday for `2001 21 Mon' incorrect: 0 instead of 21 Results after the patch: ... strptime ("2001 20 Mon", "%Y %U %a", ...) should be: wday = 1, yday = 140, mon = 4, mday = 21 is: wday = 1, yday = 139, mon = 4, mday = 20 yearday for `2001 20 Mon' incorrect: 139 instead of 140 monthday for `2001 20 Mon' incorrect: 20 instead of 21 strptime ("2001 21 Mon", "%Y %W %a", ...) should be: wday = 1, yday = 140, mon = 4, mday = 21 is: wday = 1, yday = 140, mon = 4, mday = 21 ___ So there may be a technical mismatch (GNU libc manages to reinterpret standards in amusing ways) for the %U case but the result is clearly a gain. -- You are receiving this mail because: You are the assignee for the bug.