summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/mdoc_validate.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2014-11-17 06:44:35 +0000
committerschwarze <schwarze@openbsd.org>2014-11-17 06:44:35 +0000
commit6f9818f67f5fe8cf9e8d6bca47a78366acf3c3e9 (patch)
treeb0777b4cd8d9a9c2df65f3e459255c8fb7db05ea /usr.bin/mandoc/mdoc_validate.c
parentcheck spacing and behaviour in the SEE ALSO section as well (diff)
downloadwireguard-openbsd-6f9818f67f5fe8cf9e8d6bca47a78366acf3c3e9.tar.xz
wireguard-openbsd-6f9818f67f5fe8cf9e8d6bca47a78366acf3c3e9.zip
Multiple fixes with respect to in-line macros:
* .No selects the default font; relevant e.g. in .Bf blocks * no need to force empty .Li elements * closing delimiters as leading macro arguments do not suppress space * opening delimiters at the end of a macro line do not suppress space * correctly handle delimiter spacing in -Tman As a side effect, these fixes let mandoc warn about empty .No macros as requested by bentley@.
Diffstat (limited to 'usr.bin/mandoc/mdoc_validate.c')
-rw-r--r--usr.bin/mandoc/mdoc_validate.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/usr.bin/mandoc/mdoc_validate.c b/usr.bin/mandoc/mdoc_validate.c
index a367317ca28..634fe9303fd 100644
--- a/usr.bin/mandoc/mdoc_validate.c
+++ b/usr.bin/mandoc/mdoc_validate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mdoc_validate.c,v 1.170 2014/10/30 20:05:33 schwarze Exp $ */
+/* $OpenBSD: mdoc_validate.c,v 1.171 2014/11/17 06:44:35 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -208,7 +208,7 @@ static const struct valids mdoc_valids[MDOC_MAX] = {
{ NULL, NULL }, /* Eo */
{ NULL, NULL }, /* Fx */
{ NULL, NULL }, /* Ms */
- { NULL, ewarn_eq0 }, /* No */
+ { NULL, NULL }, /* No */
{ NULL, post_ns }, /* Ns */
{ NULL, NULL }, /* Nx */
{ NULL, NULL }, /* Ox */
@@ -352,6 +352,20 @@ mdoc_valid_post(struct mdoc *mdoc)
case MDOC_ROOT:
return(post_root(mdoc));
default:
+
+ /*
+ * Closing delimiters are not special at the
+ * beginning of a block, opening delimiters
+ * are not special at the end.
+ */
+
+ if (n->child != NULL)
+ n->child->flags &= ~MDOC_DELIMC;
+ if (n->last != NULL)
+ n->last->flags &= ~MDOC_DELIMO;
+
+ /* Call the macro's postprocessor. */
+
p = mdoc_valids[n->tok].post;
return(*p ? (*p)(mdoc) : 1);
}
@@ -1161,10 +1175,6 @@ post_defaults(POST_ARGS)
if ( ! mdoc_word_alloc(mdoc, nn->line, nn->pos, "..."))
return(0);
break;
- case MDOC_Li:
- if ( ! mdoc_word_alloc(mdoc, nn->line, nn->pos, ""))
- return(0);
- break;
case MDOC_Pa:
/* FALLTHROUGH */
case MDOC_Mt: