summaryrefslogtreecommitdiffstats
path: root/mdoc_validate.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-06-27 12:18:00 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-06-27 12:18:00 +0000
commite9817d1eee252f2a60704c140932abd01803441b (patch)
treecbeb21eb9bd60a58cd0da3b9275fbc86284fda68 /mdoc_validate.c
parent7a652daded74f9e8becb34e9dca1d6202eae46fe (diff)
downloadmandoc-e9817d1eee252f2a60704c140932abd01803441b.tar.gz
warn about .Ns macros that have no effect because they are followed
by an isolated closing delimiter; inspired by mdoclint
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r--mdoc_validate.c7
1 files changed, 5 insertions, 2 deletions
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