diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-02-06 09:38:43 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-02-06 09:38:43 +0000 |
commit | a2da7908b98806106e371a1ff27e835194407859 (patch) | |
tree | 37eca625bf2d10bd6279bac7aa48420a2714f6de /man_macro.c | |
parent | 7dfb85a6973abe199100f8b965b4751bd3516595 (diff) | |
download | mandoc-a2da7908b98806106e371a1ff27e835194407859.tar.gz |
better diagnostics about excess arguments to .PD .ft .sp
Diffstat (limited to 'man_macro.c')
-rw-r--r-- | man_macro.c | 7 |
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; |