aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandoc.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2011-12-03 16:08:51 +0000
committerIngo Schwarze <schwarze@openbsd.org>2011-12-03 16:08:51 +0000
commiteb23c3ce0ca3852f947adf776def825033852227 (patch)
tree6dff372a280bc48234e4f175e613dffb32c88008 /mandoc.c
parent7c68dcb5cb39fac017a3d6fa212c698be1c6aae9 (diff)
downloadmandoc-eb23c3ce0ca3852f947adf776def825033852227.tar.gz
mandoc-eb23c3ce0ca3852f947adf776def825033852227.tar.zst
mandoc-eb23c3ce0ca3852f947adf776def825033852227.zip
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. ok kristaps@
Diffstat (limited to 'mandoc.c')
-rw-r--r--mandoc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mandoc.c b/mandoc.c
index 82756712..604bb67e 100644
--- a/mandoc.c
+++ b/mandoc.c
@@ -1,4 +1,4 @@
-/* $Id: mandoc.c,v 1.61 2011/11/06 14:43:14 kristaps Exp $ */
+/* $Id: mandoc.c,v 1.62 2011/12/03 16:08:51 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -623,9 +623,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;
}