diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-08-21 13:16:16 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-08-21 13:16:16 +0000 |
commit | b68a45dd8f587ce06c2abf7a74bf12a756e02446 (patch) | |
tree | a9f2b1e68a46fe034bd4b39bb9440bbd67ac2429 /man_validate.c | |
parent | cc7b6e7f2654427ef03598fdd28143e66c09e279 (diff) | |
download | mandoc-b68a45dd8f587ce06c2abf7a74bf12a756e02446.tar.gz |
`RS' warns if empty body.
Diffstat (limited to 'man_validate.c')
-rw-r--r-- | man_validate.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/man_validate.c b/man_validate.c index a2507a85..f5878ef2 100644 --- a/man_validate.c +++ b/man_validate.c @@ -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) { |