diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-04-13 09:57:08 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-04-13 09:57:08 +0000 |
commit | 21987bf9ae5077818d53867b4ccd8380a6d9c3da (patch) | |
tree | 04e285d753bf650183b8bc397a29ca7b3c43aa1a /man_validate.c | |
parent | d549a3e085f3da5351670c0be0397467fa1394e7 (diff) | |
download | mandoc-21987bf9ae5077818d53867b4ccd8380a6d9c3da.tar.gz |
Remove the warning for empty bodies of `Sh', `Ss', `SH', and `SS'. This
prompted by a TODO by schwarze@, originally from Gleydson Soares, that
an empty `SS' was raising an error (it hasn't for some time). It makes
sense these shouldn't warn, as omitting their contents doesn't change
anything in the structure of the document (groff and mandoc specifically
account for the whitespace between empty sections).
This doesn't change any manuals, which only refer to the line arguments
(or possibly next-line, in the case of man(7) syntax).
Diffstat (limited to 'man_validate.c')
-rw-r--r-- | man_validate.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/man_validate.c b/man_validate.c index c1968989..6a72c0bd 100644 --- a/man_validate.c +++ b/man_validate.c @@ -325,14 +325,11 @@ static int check_sec(CHKARGS) { - if (MAN_HEAD == n->type && 0 == n->nchild) { - man_nmsg(m, n, MANDOCERR_SYNTARGCOUNT); - return(0); - } else if (MAN_BODY == n->type && 0 == n->nchild) - mandoc_msg(MANDOCERR_ARGCWARN, m->parse, n->line, - n->pos, "want children (have none)"); + if ( ! (MAN_HEAD == n->type && 0 == n->nchild)) + return(1); - return(1); + man_nmsg(m, n, MANDOCERR_SYNTARGCOUNT); + return(0); } |