tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
* do not reformat man(7)-style dates
@ 2011-11-01 16:24 Ingo Schwarze
  2011-11-03 15:35 ` Kristaps Dzonsons
  0 siblings, 1 reply; 3+ messages in thread
From: Ingo Schwarze @ 2011-11-01 16:24 UTC (permalink / raw)
  To: tech

Hi,

while it's certainly a nice idea to reformat YYYY-MM-DD dates,
which are common in man(7) manuals, to the Month Day, Year form
used by mdoc(7), groff does not do this.  I prefer groff-mandoc
compatibility over man-mdoc uniformity in case the two conflict.

So continue to accept YYYY-MM-DD, still do not warn about it,
and leave the formatting untouched.

OK?
  Ingo


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;
 	}
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-11-13 11:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-01 16:24 do not reformat man(7)-style dates Ingo Schwarze
2011-11-03 15:35 ` Kristaps Dzonsons
2011-11-13 11:43   ` Ingo Schwarze

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).