aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-04-13 09:57:08 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-04-13 09:57:08 +0000
commitd6a0b76fecae20088bd4d276cdd0eb2f041d59ec (patch)
treea869615bb1e7d8d3f17eb922da61febc148a0ddb
parentf34dee17801e8624ff26bc038d094572f4758655 (diff)
downloadmandoc-d6a0b76fecae20088bd4d276cdd0eb2f041d59ec.tar.gz
mandoc-d6a0b76fecae20088bd4d276cdd0eb2f041d59ec.tar.zst
mandoc-d6a0b76fecae20088bd4d276cdd0eb2f041d59ec.zip
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).
-rw-r--r--man_validate.c13
-rw-r--r--mdoc_validate.c6
2 files changed, 8 insertions, 11 deletions
diff --git a/man_validate.c b/man_validate.c
index e744ed3c..e0c882d4 100644
--- a/man_validate.c
+++ b/man_validate.c
@@ -1,4 +1,4 @@
-/* $Id: man_validate.c,v 1.68 2011/04/09 15:29:40 kristaps Exp $ */
+/* $Id: man_validate.c,v 1.69 2011/04/13 09:57:08 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -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);
}
diff --git a/mdoc_validate.c b/mdoc_validate.c
index d3f46076..6f711116 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_validate.c,v 1.167 2011/04/09 15:29:40 kristaps Exp $ */
+/* $Id: mdoc_validate.c,v 1.168 2011/04/13 09:57:08 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -155,9 +155,9 @@ static v_post posts_notext[] = { ewarn_eq0, NULL };
static v_post posts_ns[] = { post_ns, NULL };
static v_post posts_os[] = { post_os, post_prol, NULL };
static v_post posts_rs[] = { post_rs, NULL };
-static v_post posts_sh[] = { post_ignpar, hwarn_ge1, bwarn_ge1, post_sh, NULL };
+static v_post posts_sh[] = { post_ignpar, hwarn_ge1, post_sh, NULL };
static v_post posts_sp[] = { ewarn_le1, NULL };
-static v_post posts_ss[] = { post_ignpar, hwarn_ge1, bwarn_ge1, NULL };
+static v_post posts_ss[] = { post_ignpar, hwarn_ge1, NULL };
static v_post posts_st[] = { post_st, NULL };
static v_post posts_std[] = { post_std, NULL };
static v_post posts_text[] = { ewarn_ge1, NULL };