diff options
author | 2015-02-06 09:38:22 +0000 | |
---|---|---|
committer | 2015-02-06 09:38:22 +0000 | |
commit | e5d5fd76cd96213fc8f52be75b808ffa9ea12a0b (patch) | |
tree | 0053b7b1c3c18d7d1186e0ecf7fe57d79db54e2a /usr.bin/mandoc/man_macro.c | |
parent | Import BoringSSL's crypto bytestring and crypto bytebuilder APIs. (diff) | |
download | wireguard-openbsd-e5d5fd76cd96213fc8f52be75b808ffa9ea12a0b.tar.xz wireguard-openbsd-e5d5fd76cd96213fc8f52be75b808ffa9ea12a0b.zip |
better diagnostics about excess arguments to .PD .ft .sp
Diffstat (limited to 'usr.bin/mandoc/man_macro.c')
-rw-r--r-- | usr.bin/mandoc/man_macro.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.bin/mandoc/man_macro.c b/usr.bin/mandoc/man_macro.c index 413f56f63fe..7843c4e7eb8 100644 --- a/usr.bin/mandoc/man_macro.c +++ b/usr.bin/mandoc/man_macro.c @@ -1,4 +1,4 @@ -/* $OpenBSD: man_macro.c,v 1.58 2015/02/06 08:28:03 schwarze Exp $ */ +/* $OpenBSD: man_macro.c,v 1.59 2015/02/06 09:38:22 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2012, 2013, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org> @@ -425,6 +425,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; |