Date: Mon, 8 Apr 2002 17:48:17 -0400 (EDT) From: Ray Kohler <ataraxia@cox.rr.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/36902: [patch] proposed new format code %N for strftime(3) Message-ID: <200204082148.g38LmHYq043439@cox.rr.com>
next in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200204082148.g38LmHYq043439>
