diff options
author | 2014-07-03 21:23:08 +0000 | |
---|---|---|
committer | 2014-07-03 21:23:08 +0000 | |
commit | c451531b6ec07e9f142a060e40b45795cedfcc68 (patch) | |
tree | 1fceb42f2ef8799d0b6fc46a8f0f83db8a6adfcc | |
parent | Memory-leak-in-error-path of the day in X509_ATTRIBUTE_set1_data(). (diff) | |
download | wireguard-openbsd-c451531b6ec07e9f142a060e40b45795cedfcc68.tar.xz wireguard-openbsd-c451531b6ec07e9f142a060e40b45795cedfcc68.zip |
MANDOCERR_NOARGS reported three completely unrelated classes of problems.
Split the roff(7) parts out of it and report the request names for these cases.
-rw-r--r-- | regress/usr.bin/mandoc/roff/cond/Makefile | 3 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/roff/cond/if.out_lint | 2 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/roff/de/Makefile | 3 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/roff/de/escname.in | 1 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/roff/de/escname.out_lint | 7 | ||||
-rw-r--r-- | usr.bin/mandoc/mandoc.h | 6 | ||||
-rw-r--r-- | usr.bin/mandoc/read.c | 4 | ||||
-rw-r--r-- | usr.bin/mandoc/roff.c | 8 |
8 files changed, 26 insertions, 8 deletions
diff --git a/regress/usr.bin/mandoc/roff/cond/Makefile b/regress/usr.bin/mandoc/roff/cond/Makefile index 11511142584..fd88fc0988e 100644 --- a/regress/usr.bin/mandoc/roff/cond/Makefile +++ b/regress/usr.bin/mandoc/roff/cond/Makefile @@ -1,5 +1,6 @@ -# $OpenBSD: Makefile,v 1.5 2014/03/08 04:43:39 schwarze Exp $ +# $OpenBSD: Makefile,v 1.6 2014/07/03 21:23:08 schwarze Exp $ REGRESS_TARGETS = if ie close numeric strcmp before-Dd +LINT_TARGETS = if .include <bsd.regress.mk> diff --git a/regress/usr.bin/mandoc/roff/cond/if.out_lint b/regress/usr.bin/mandoc/roff/cond/if.out_lint new file mode 100644 index 00000000000..bb8e2d3ad48 --- /dev/null +++ b/regress/usr.bin/mandoc/roff/cond/if.out_lint @@ -0,0 +1,2 @@ +mandoc: if.in:14:1: WARNING: conditional request controls empty scope: if +mandoc: if.in:16:1: WARNING: conditional request controls empty scope: if diff --git a/regress/usr.bin/mandoc/roff/de/Makefile b/regress/usr.bin/mandoc/roff/de/Makefile index 390c004849c..18947237065 100644 --- a/regress/usr.bin/mandoc/roff/de/Makefile +++ b/regress/usr.bin/mandoc/roff/de/Makefile @@ -1,6 +1,7 @@ -# $OpenBSD: Makefile,v 1.3 2014/06/29 23:23:16 schwarze Exp $ +# $OpenBSD: Makefile,v 1.4 2014/07/03 21:23:08 schwarze Exp $ REGRESS_TARGETS = escname TH Dd +LINT_TARGETS = escname .include <bsd.regress.mk> diff --git a/regress/usr.bin/mandoc/roff/de/escname.in b/regress/usr.bin/mandoc/roff/de/escname.in index db5b0506254..a75a2679551 100644 --- a/regress/usr.bin/mandoc/roff/de/escname.in +++ b/regress/usr.bin/mandoc/roff/de/escname.in @@ -39,4 +39,5 @@ macro seperated from argument by an escape sequence: .. .witharg\(enargument .Pp +.de\e final text diff --git a/regress/usr.bin/mandoc/roff/de/escname.out_lint b/regress/usr.bin/mandoc/roff/de/escname.out_lint new file mode 100644 index 00000000000..2eecd35d7e0 --- /dev/null +++ b/regress/usr.bin/mandoc/roff/de/escname.out_lint @@ -0,0 +1,7 @@ +mandoc: escname.in:21:1: ERROR: escaped character not allowed in a name +mandoc: escname.in:31:19: ERROR: escaped character not allowed in a name +mandoc: escname.in:32:2: ERROR: skipping unknown macro: .first +mandoc: escname.in:34:2: ERROR: skipping unknown macro: .first\\second +mandoc: escname.in:40:1: ERROR: escaped character not allowed in a name +mandoc: escname.in:42:1: ERROR: escaped character not allowed in a name +mandoc: escname.in:42:1: WARNING: skipping empty request: de diff --git a/usr.bin/mandoc/mandoc.h b/usr.bin/mandoc/mandoc.h index 71940bfcf0e..4c44ee81484 100644 --- a/usr.bin/mandoc/mandoc.h +++ b/usr.bin/mandoc/mandoc.h @@ -1,4 +1,4 @@ -/* $Id: mandoc.h,v 1.74 2014/07/02 20:18:42 schwarze Exp $ */ +/* $Id: mandoc.h,v 1.75 2014/07/03 21:23:08 schwarze Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org> @@ -83,7 +83,9 @@ enum mandocerr { MANDOCERR_NF_SKIP, /* fill mode already disabled, skipping .nf */ MANDOCERR_LINESCOPE, /* line scope broken: macro breaks macro */ - /* related to missing macro arguments */ + /* related to missing arguments */ + MANDOCERR_REQ_EMPTY, /* skipping empty request: request */ + MANDOCERR_COND_EMPTY, /* conditional request controls empty scope */ MANDOCERR_MACRO_EMPTY, /* skipping empty macro: macro */ MANDOCERR_ARGCWARN, /* argument count wrong */ MANDOCERR_DISPTYPE, /* missing display type */ diff --git a/usr.bin/mandoc/read.c b/usr.bin/mandoc/read.c index 09fd7143e64..c5d4781aec2 100644 --- a/usr.bin/mandoc/read.c +++ b/usr.bin/mandoc/read.c @@ -1,4 +1,4 @@ -/* $Id: read.c,v 1.35 2014/07/02 13:10:15 schwarze Exp $ */ +/* $Id: read.c,v 1.36 2014/07/03 21:23:08 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org> @@ -120,6 +120,8 @@ static const char * const mandocerrs[MANDOCERR_MAX] = { "line scope broken", /* related to missing macro arguments */ + "skipping empty request", + "conditional request controls empty scope", "skipping empty macro", "argument count wrong", "missing display type", diff --git a/usr.bin/mandoc/roff.c b/usr.bin/mandoc/roff.c index 427371409af..e7ac91ec990 100644 --- a/usr.bin/mandoc/roff.c +++ b/usr.bin/mandoc/roff.c @@ -1,4 +1,4 @@ -/* $Id: roff.c,v 1.88 2014/07/01 00:32:02 schwarze Exp $ */ +/* $Id: roff.c,v 1.89 2014/07/03 21:23:08 schwarze Exp $ */ /* * Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org> @@ -913,7 +913,8 @@ roff_block(ROFF_ARGS) if (ROFF_ig != tok) { if ('\0' == *cp) { - mandoc_msg(MANDOCERR_NOARGS, r->parse, ln, ppos, NULL); + mandoc_msg(MANDOCERR_REQ_EMPTY, r->parse, + ln, ppos, roffs[tok].name); return(ROFF_IGN); } @@ -1281,7 +1282,8 @@ roff_cond(ROFF_ARGS) */ if ('\0' == (*bufp)[pos]) - mandoc_msg(MANDOCERR_NOARGS, r->parse, ln, ppos, NULL); + mandoc_msg(MANDOCERR_COND_EMPTY, r->parse, + ln, ppos, roffs[tok].name); r->last->endspan = 1; |