summaryrefslogtreecommitdiffstats
path: root/mdoc_macro.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-02-04 22:30:10 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-02-04 22:30:10 +0000
commit9428c0388cfeb9544f5ffec7200f5fbee7da4727 (patch)
tree09ad909823009a69446d079d83d7de4a08b95855 /mdoc_macro.c
parent58bcb2f42259b0f030965cd8437c90e4704edb0e (diff)
downloadmandoc-9428c0388cfeb9544f5ffec7200f5fbee7da4727.tar.gz
Discard excess head arguments for .Bd .Bl .Bk and delete hwarn_eq0().
Discard empty .Bk blocks. Improve related diagnostics.
Diffstat (limited to 'mdoc_macro.c')
-rw-r--r--mdoc_macro.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/mdoc_macro.c b/mdoc_macro.c
index 14a2ef27..5a8fd3f2 100644
--- a/mdoc_macro.c
+++ b/mdoc_macro.c
@@ -1042,6 +1042,12 @@ blk_full(MACRO_PROT_ARGS)
body = mdoc_body_alloc(mdoc, line, ppos, tok);
break;
}
+ if (tok == MDOC_Bd || tok == MDOC_Bk) {
+ mandoc_vmsg(MANDOCERR_ARG_EXCESS,
+ mdoc->parse, line, la, "%s ... %s",
+ mdoc_macronames[tok], buf + la);
+ break;
+ }
if (tok == MDOC_Rs) {
mandoc_vmsg(MANDOCERR_ARG_SKIP, mdoc->parse,
line, la, "Rs %s", buf + la);
@@ -1105,7 +1111,7 @@ blk_full(MACRO_PROT_ARGS)
return;
if (head == NULL)
head = mdoc_head_alloc(mdoc, line, ppos, tok);
- if (nl && tok != MDOC_Rs)
+ if (nl && tok != MDOC_Bd && tok != MDOC_Bl && tok != MDOC_Rs)
append_delims(mdoc, line, pos, buf);
if (body != NULL)
goto out;