tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: tech@mdocml.bsd.lv
Subject: Re: do not reformat man(7)-style dates
Date: Sun, 13 Nov 2011 12:43:23 +0100	[thread overview]
Message-ID: <20111113114323.GD3374@iris.usta.de> (raw)
In-Reply-To: <4EB2B4AC.8070407@bsd.lv>

Hi Kristaps,

Kristaps Dzonsons wrote on Thu, Nov 03, 2011 at 04:35:08PM +0100:
> Ingo Schwarze wrote:

>>Index: mandoc.c
>>===================================================================
>>RCS file: /cvs/src/usr.bin/mandoc/mandoc.c,v
>>retrieving revision 1.29
>>diff -u -p -r1.29 mandoc.c
>>--- mandoc.c	24 Oct 2011 20:29:21 -0000	1.29
>>+++ mandoc.c	1 Nov 2011 16:26:24 -0000
>>@@ -609,9 +609,10 @@ mandoc_normdate(struct mparse *parse, ch
>>  		mandoc_msg(MANDOCERR_NODATE, parse, ln, pos, NULL);
>>  		time(&t);
>>  	}
>>+	else if (a2time(&t, "%Y-%m-%d", in))
>>+		t = 0;
>>  	else if (!a2time(&t, "$" "Mdocdate: %b %d %Y $", in)&&
>>-	    !a2time(&t, "%b %d, %Y", in)&&
>>-	    !a2time(&t, "%Y-%m-%d", in)) {
>>+	    !a2time(&t, "%b %d, %Y", in)) {
>>  		mandoc_msg(MANDOCERR_BADDATE, parse, ln, pos, NULL);
>>  		t = 0;
>>  	}

> Isn't it easier just to do as in the enclosed patch?

Even though your patch is much larger than mine,
the resulting code is slightly simpler; granted.

> man(7) doesn't seem to care at all about the date, so let's stop
> pretending that it does and just mandoc_strdup() instead of
> mandoc_normdate().

Still, i don't like that approach.  Even if groff does not care,
i'd still like to provide a WARNING if somebody puts

  "Febuary 30, 2o11"   \" note: three typos
  "20l1_31_12"         \" note: three errors

into a man(7) document.

Thus, i prefer my patch.

Yours,
  Ingo
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

      reply	other threads:[~2011-11-13 11:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-01 16:24 Ingo Schwarze
2011-11-03 15:35 ` Kristaps Dzonsons
2011-11-13 11:43   ` Ingo Schwarze [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111113114323.GD3374@iris.usta.de \
    --to=schwarze@usta.de \
    --cc=tech@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).