diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2011-11-17 11:58:12 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2011-11-17 11:58:12 +0000 |
commit | 2b63cadef46650bf5cdbec3a97d285d1ef1215a8 (patch) | |
tree | b505e9a2e7334c6020ac0729a46f7cd53b581e5c /usr.bin/mandoc/mandoc.c | |
parent | 1000d3d29a634ec239d71c2ebe1ce4a03e5ca564 (diff) |
ISO style "%Y-%m-%d" dates are common in man(7) .TH.
They have been considered valid in the past, but were reformatted
to the mdoc(7) "Month day, year" style.
To make page footers more similar to groff, no longer reformat them,
just print them as they are.
This doesn't change anything with respect to what's considered valid
or what is warned about.
Putting this in now such that i can improve the unit test suite.
Diffstat (limited to 'usr.bin/mandoc/mandoc.c')
-rw-r--r-- | usr.bin/mandoc/mandoc.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/mandoc/mandoc.c b/usr.bin/mandoc/mandoc.c index 7e1c66ed9ec..842cea4b3b2 100644 --- a/usr.bin/mandoc/mandoc.c +++ b/usr.bin/mandoc/mandoc.c @@ -1,4 +1,4 @@ -/* $Id: mandoc.c,v 1.30 2011/11/12 22:31:22 schwarze Exp $ */ +/* $Id: mandoc.c,v 1.31 2011/11/17 11:58:11 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org> @@ -616,9 +616,10 @@ mandoc_normdate(struct mparse *parse, char *in, int ln, int pos) 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; } |