summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/mandoc.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2018-07-28 18:32:31 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2018-07-28 18:32:31 +0000
commite782686b11eba299de4c7e9149e1a7286c51f6a8 (patch)
tree5bd6eedef5695c2f002aabf69da7e07ceea2df1d /usr.bin/mandoc/mandoc.c
parent6786e9d847fde497201cb33ff128dbd836648e38 (diff)
Issue a STYLE message when normalizing the date format in .Dd/.TH.
Leah Neukirchen pointed out that mdoclint(1) used to warn about a leading zero before the day number, so we know that both NetBSD and Void Linux want the message. It does no harm on OpenBSD because Mdocdate always does the right thing anyway. jmc@ agrees that it makes sense in contexts not using Mdocdate.
Diffstat (limited to 'usr.bin/mandoc/mandoc.c')
-rw-r--r--usr.bin/mandoc/mandoc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/mandoc/mandoc.c b/usr.bin/mandoc/mandoc.c
index 92637e41d93..81a658fad92 100644
--- a/usr.bin/mandoc/mandoc.c
+++ b/usr.bin/mandoc/mandoc.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: mandoc.c,v 1.71 2017/07/03 13:40:00 schwarze Exp $ */
+/* $OpenBSD: mandoc.c,v 1.72 2018/07/28 18:32:30 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2011-2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2011-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -536,6 +536,9 @@ mandoc_normdate(struct roff_man *man, char *in, int ln, int pos)
if (t > time(NULL) + 86400)
mandoc_msg(MANDOCERR_DATE_FUTURE, man->parse,
ln, pos, cp);
+ else if (*in != '$' && strcmp(in, cp) != 0)
+ mandoc_msg(MANDOCERR_DATE_NORM, man->parse,
+ ln, pos, cp);
return cp;
}