summaryrefslogtreecommitdiffstats
path: root/man_macro.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-02-06 09:38:43 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-02-06 09:38:43 +0000
commita2da7908b98806106e371a1ff27e835194407859 (patch)
tree37eca625bf2d10bd6279bac7aa48420a2714f6de /man_macro.c
parent7dfb85a6973abe199100f8b965b4751bd3516595 (diff)
downloadmandoc-a2da7908b98806106e371a1ff27e835194407859.tar.gz
better diagnostics about excess arguments to .PD .ft .sp
Diffstat (limited to 'man_macro.c')
-rw-r--r--man_macro.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/man_macro.c b/man_macro.c
index 6ed50df7..88f1f431 100644
--- a/man_macro.c
+++ b/man_macro.c
@@ -427,6 +427,13 @@ in_line_eoln(MACRO_PROT_ARGS)
man_macronames[tok], buf + *pos);
break;
}
+ if (buf[*pos] != '\0' && man->last != n &&
+ (tok == MAN_PD || tok == MAN_ft || tok == MAN_sp)) {
+ mandoc_vmsg(MANDOCERR_ARG_EXCESS,
+ man->parse, line, *pos, "%s ... %s",
+ man_macronames[tok], buf + *pos);
+ break;
+ }
la = *pos;
if ( ! man_args(man, line, pos, buf, &p))
break;