From e9817d1eee252f2a60704c140932abd01803441b Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Tue, 27 Jun 2017 12:18:00 +0000 Subject: warn about .Ns macros that have no effect because they are followed by an isolated closing delimiter; inspired by mdoclint --- mdoc_validate.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'mdoc_validate.c') diff --git a/mdoc_validate.c b/mdoc_validate.c index 42a51afd..5be54f6b 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -1983,10 +1983,13 @@ post_hyph(POST_ARGS) static void post_ns(POST_ARGS) { + struct roff_node *n; - if (mdoc->last->flags & NODE_LINE) + n = mdoc->last; + if (n->flags & NODE_LINE || + (n->next != NULL && n->next->flags & NODE_DELIMC)) mandoc_msg(MANDOCERR_NS_SKIP, mdoc->parse, - mdoc->last->line, mdoc->last->pos, NULL); + n->line, n->pos, NULL); } static void -- cgit