aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/man_validate.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-03-22 15:30:30 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-03-22 15:30:30 +0000
commit35e4167ecdd8989ebb6e628716d98878b5e632fd (patch)
treea61676aed004c0c4ec0c195910fd841936f48780 /man_validate.c
parent243bedea9d0bff837d56fae223de2056e3d70f1a (diff)
downloadmandoc-35e4167ecdd8989ebb6e628716d98878b5e632fd.tar.gz
mandoc-35e4167ecdd8989ebb6e628716d98878b5e632fd.tar.zst
mandoc-35e4167ecdd8989ebb6e628716d98878b5e632fd.zip
Make empty sections and parts (SH, SS, RS) only produce a warning if it
has no children. Noted by Brad, added to TODO by schwarze@.
Diffstat (limited to 'man_validate.c')
-rw-r--r--man_validate.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/man_validate.c b/man_validate.c
index e56415ba..03bb120f 100644
--- a/man_validate.c
+++ b/man_validate.c
@@ -1,4 +1,4 @@
-/* $Id: man_validate.c,v 1.66 2011/03/22 14:33:05 kristaps Exp $ */
+/* $Id: man_validate.c,v 1.67 2011/03/22 15:30:30 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -323,7 +323,8 @@ check_sec(CHKARGS)
man_nmsg(m, n, MANDOCERR_SYNTARGCOUNT);
return(0);
} else if (MAN_BODY == n->type && 0 == n->nchild)
- man_nmsg(m, n, MANDOCERR_NOBODY);
+ mandoc_msg(MANDOCERR_ARGCWARN, m->parse, n->line,
+ n->pos, "want children (have none)");
return(1);
}
@@ -334,7 +335,8 @@ check_part(CHKARGS)
{
if (MAN_BODY == n->type && 0 == n->nchild)
- man_nmsg(m, n, MANDOCERR_NOBODY);
+ mandoc_msg(MANDOCERR_ARGCWARN, m->parse, n->line,
+ n->pos, "want children (have none)");
return(1);
}