Author: imp
Date: Wed Apr 24 05:24:10 2019
New Revision: 346624
URL: https://svnweb.freebsd.org/changeset/base/346624

Log:
  Restore the -n flag parsing, but ignore it.
  
  Since D19668 was done, new users of the -n flag have surfaced. Parse
  and ignore it on the command line until they can be updated.
  
  Suggested by: rgrimes (in D19668).

Modified:
  head/bin/date/date.1
  head/bin/date/date.c

Modified: head/bin/date/date.1
==============================================================================
--- head/bin/date/date.1        Wed Apr 24 04:50:03 2019        (r346623)
+++ head/bin/date/date.1        Wed Apr 24 05:24:10 2019        (r346624)
@@ -32,7 +32,7 @@
 .\"     @(#)date.1     8.3 (Berkeley) 4/28/95
 .\" $FreeBSD$
 .\"
-.Dd March 20, 2019
+.Dd April 23, 2019
 .Dt DATE 1
 .Os
 .Sh NAME
@@ -40,7 +40,7 @@
 .Nd display or set date and time
 .Sh SYNOPSIS
 .Nm
-.Op Fl jRu
+.Op Fl jnRu
 .Op Fl r Ar seconds | Ar filename
 .Oo
 .Fl v
@@ -142,6 +142,8 @@ This allows you to use the
 flag in addition to the
 .Cm +
 option to convert one date format to another.
+.It Fl n
+Obsolete flag, accepted and ignored for compatibility.
 .It Fl R
 Use RFC 2822 date and time output format.
 This is equivalent to using

Modified: head/bin/date/date.c
==============================================================================
--- head/bin/date/date.c        Wed Apr 24 04:50:03 2019        (r346623)
+++ head/bin/date/date.c        Wed Apr 24 05:24:10 2019        (r346624)
@@ -108,7 +108,7 @@ main(int argc, char *argv[])
        (void) setlocale(LC_TIME, "");
        rflag = 0;
        Iflag = jflag = Rflag = 0;
-       while ((ch = getopt(argc, argv, "f:I::jRr:uv:")) != -1)
+       while ((ch = getopt(argc, argv, "f:I::jnRr:uv:")) != -1)
                switch((char)ch) {
                case 'f':
                        fmt = optarg;
@@ -131,6 +131,8 @@ main(int argc, char *argv[])
                        break;
                case 'j':
                        jflag = 1;      /* don't set time */
+                       break;
+               case 'n':
                        break;
                case 'R':               /* RFC 2822 datetime format */
                        if (Iflag)


_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to