diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-07-03 21:23:09 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-07-03 21:23:09 +0000 |
commit | 76e7ee2ebea7905a2ec9b4235f57b00b0522f61a (patch) | |
tree | 98fb31f051857a9b161596dadf1aac4eed0fa763 /usr.bin/mandoc | |
parent | 0a3891d795831a44f7e086e8ef0936bf7e165c23 (diff) |
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.
Diffstat (limited to 'usr.bin/mandoc')
-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 |
3 files changed, 12 insertions, 6 deletions
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; |