summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-08-21 13:16:16 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-08-21 13:16:16 +0000
commit475a43fe2ff686ed3fe9cde81cbdb43fd2c6016e (patch)
treeecc71b165f6a1f6d2ead999c8df89a0844010e9c
parent99a6b3d8600cc900aab0758eb53c7c73622876f2 (diff)
downloadmandoc-475a43fe2ff686ed3fe9cde81cbdb43fd2c6016e.tar.gz
mandoc-475a43fe2ff686ed3fe9cde81cbdb43fd2c6016e.tar.zst
mandoc-475a43fe2ff686ed3fe9cde81cbdb43fd2c6016e.zip
`RS' warns if empty body.
-rw-r--r--man_validate.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/man_validate.c b/man_validate.c
index d8568762..a59d4dc3 100644
--- a/man_validate.c
+++ b/man_validate.c
@@ -1,4 +1,4 @@
-/* $Id: man_validate.c,v 1.22 2009/08/21 12:12:12 kristaps Exp $ */
+/* $Id: man_validate.c,v 1.23 2009/08/21 13:16:16 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -41,6 +41,7 @@ static int check_eq1(CHKARGS);
static int check_ge2(CHKARGS);
static int check_le5(CHKARGS);
static int check_par(CHKARGS);
+static int check_part(CHKARGS);
static int check_root(CHKARGS);
static int check_sec(CHKARGS);
static int check_sp(CHKARGS);
@@ -49,6 +50,7 @@ static int check_text(CHKARGS);
static v_check posts_eq0[] = { check_eq0, NULL };
static v_check posts_ge2_le5[] = { check_ge2, check_le5, NULL };
static v_check posts_par[] = { check_par, NULL };
+static v_check posts_part[] = { check_part, NULL };
static v_check posts_sec[] = { check_sec, NULL };
static v_check posts_sp[] = { check_sp, NULL };
static v_check pres_bline[] = { check_bline, NULL };
@@ -82,7 +84,7 @@ static const struct man_valid man_valids[MAN_MAX] = {
{ pres_bline, posts_eq0 }, /* fi */
{ NULL, NULL }, /* r */
{ NULL, NULL }, /* RE */
- { NULL, NULL }, /* RS */ /* FIXME: warn if empty body. */
+ { NULL, posts_part }, /* RS */
{ NULL, NULL }, /* DT */
};
@@ -250,6 +252,16 @@ check_sec(CHKARGS)
static int
+check_part(CHKARGS)
+{
+
+ if (MAN_BODY == n->type && 0 == n->nchild)
+ return(man_nwarn(m, n, WBODYARGS));
+ return(1);
+}
+
+
+static int
check_par(CHKARGS)
{