diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2018-07-28 18:34:15 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2018-07-28 18:34:15 +0000 |
commit | c69a5c16ba14a67d916b1beebd5ab71b237169e3 (patch) | |
tree | 523e30ab975e9ef4dfdb8f46c1e49b93e31b3c06 /mandoc.c | |
parent | a6ba24dda6e56afe0403d5505d44bde5da7659b6 (diff) | |
download | mandoc-c69a5c16ba14a67d916b1beebd5ab71b237169e3.tar.gz mandoc-c69a5c16ba14a67d916b1beebd5ab71b237169e3.tar.zst mandoc-c69a5c16ba14a67d916b1beebd5ab71b237169e3.zip |
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 'mandoc.c')
-rw-r--r-- | mandoc.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1,7 +1,7 @@ -/* $Id: mandoc.c,v 1.103 2017/07/03 13:40:19 schwarze Exp $ */ +/* $Id: mandoc.c,v 1.104 2018/07/28 18:34:15 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 @@ -541,6 +541,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; } |