summaryrefslogtreecommitdiffstats
path: root/mdoc_validate.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-06-01 15:25:39 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-06-01 15:25:39 +0000
commit8aa141e07f78054e526f8f85ec8f12e47a40fbb9 (patch)
tree57a1e7e10365e92680ec141b62d421642ec90dc0 /mdoc_validate.c
parent97d9e8867b464b881cf5d4f88296991990492d49 (diff)
downloadmandoc-8aa141e07f78054e526f8f85ec8f12e47a40fbb9.tar.gz
STYLE message about full stop at the end of .Nd; inspired by mdoclint(1)
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r--mdoc_validate.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c
index 1a9dce2b..98e6a77d 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1076,6 +1076,7 @@ static void
post_nd(POST_ARGS)
{
struct roff_node *n;
+ size_t sz;
n = mdoc->last;
@@ -1089,6 +1090,11 @@ post_nd(POST_ARGS)
if (n->child == NULL)
mandoc_msg(MANDOCERR_ND_EMPTY, mdoc->parse,
n->line, n->pos, "Nd");
+ else if (n->last->type == ROFFT_TEXT &&
+ (sz = strlen(n->last->string)) != 0 &&
+ n->last->string[sz - 1] == '.')
+ mandoc_msg(MANDOCERR_ND_DOT, mdoc->parse,
+ n->last->line, n->last->pos + sz - 1, NULL);
post_hyph(mdoc);
}