From owner-freebsd-bugs Mon Apr 8 14:50:12 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 91E6537B405 for ; Mon, 8 Apr 2002 14:50:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g38Lo1c53031; Mon, 8 Apr 2002 14:50:01 -0700 (PDT) (envelope-from gnats) Received: from mail5.mgfairfax.rr.com (fe5.southeast.rr.com [24.93.67.52]) by hub.freebsd.org (Postfix) with ESMTP id 18CE137B440 for ; Mon, 8 Apr 2002 14:48:19 -0700 (PDT) Received: from cox.rr.com ([24.168.213.144]) by mail5.mgfairfax.rr.com with Microsoft SMTPSVC(5.5.1877.687.68); Mon, 8 Apr 2002 17:48:17 -0400 Received: (from ataraxia@localhost) by cox.rr.com (8.12.2/8.12.2/Submit) id g38LmHYq043439; Mon, 8 Apr 2002 17:48:17 -0400 (EDT) Message-Id: <200204082148.g38LmHYq043439@cox.rr.com> Date: Mon, 8 Apr 2002 17:48:17 -0400 (EDT) From: Ray Kohler To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/36902: [patch] proposed new format code %N for strftime(3) 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 >Number: 36902 >Category: bin >Synopsis: [patch] proposed new format code %N for strftime(3) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Apr 08 14:50:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Ray Kohler >Release: FreeBSD 4.5-STABLE i386 >Organization: >Environment: System: FreeBSD beastie.cox.rr.com 4.5-STABLE FreeBSD 4.5-STABLE #5: Fri Apr 5 18:55:57 EST 2002 root@beastie.cox.rr.com:/usr/obj/usr/src/sys/BEASTIE i386 >Description: Since we have %d and %e for printing day numbers with and without leading 0's, it seems reasonable that we should have the same choice for month numbers. I propose %N for the new format (all the good ones are taken :( ). Diffs against -current follow. >How-To-Repeat: >Fix: Index: strftime.3 =================================================================== RCS file: /home/ncvs/src/lib/libc/stdtime/strftime.3,v retrieving revision 1.27 diff -u -u -r1.27 strftime.3 --- strftime.3 2001/10/01 16:08:59 1.27 +++ strftime.3 2002/04/08 21:47:25 @@ -145,6 +145,9 @@ is replaced by the minute as a decimal number (00-59). .It Cm %m is replaced by the month as a decimal number (01-12). +.It Cm \&%N +is replaced by the month as a decimal number (1-12); single +digits are preceded by a blank. .It Cm %n is replaced by a newline. .It Cm \&%O* Index: strftime.c =================================================================== RCS file: /home/ncvs/src/lib/libc/stdtime/strftime.c,v retrieving revision 1.35 diff -u -u -r1.35 strftime.c --- strftime.c 2002/03/22 21:53:13 1.35 +++ strftime.c 2002/04/08 21:47:25 @@ -208,6 +208,9 @@ case 'm': pt = _conv(t->tm_mon + 1, "%02d", pt, ptlim); continue; + case 'N': + pt = _conv(t->tm_mon + 1, "%2d", pt, ptlim); + continue; case 'n': pt = _add("\n", pt, ptlim); continue; >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message