diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2011-11-05 16:02:19 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2011-11-05 16:02:19 +0000 |
commit | 1510037a570f6f9f36441934ce9ed183ae1d9e7f (patch) | |
tree | 89d8fcd9545d9098bce89490a7486488d2ff5d60 /usr.bin/mandoc/man_validate.c | |
parent | 5633fe7bead0008d9d2e696526ab301c70f20ca0 (diff) |
When the HEAD scope of .TP is broken by another block macro,
do not abort with a FATAL error, but report a regular ERROR,
remove the broken .TP from the syntax tree, and prod on.
Reported repeatedly by ports people, at least by brad@ and jeremy@.
Also fixes rendition(4) in Xenocara.
Diffstat (limited to 'usr.bin/mandoc/man_validate.c')
-rw-r--r-- | usr.bin/mandoc/man_validate.c | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/usr.bin/mandoc/man_validate.c b/usr.bin/mandoc/man_validate.c index 19ce4aa6784..dcdb5e8cc8a 100644 --- a/usr.bin/mandoc/man_validate.c +++ b/usr.bin/mandoc/man_validate.c @@ -1,4 +1,4 @@ -/* $Id: man_validate.c,v 1.49 2011/11/03 20:46:40 schwarze Exp $ */ +/* $Id: man_validate.c,v 1.50 2011/11/05 16:02:18 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org> @@ -40,7 +40,6 @@ struct man_valid { v_check *posts; }; -static int check_bline(CHKARGS); static int check_eq0(CHKARGS); static int check_le1(CHKARGS); static int check_ge2(CHKARGS); @@ -72,20 +71,19 @@ static v_check posts_sec[] = { post_sec, NULL }; static v_check posts_sp[] = { post_vs, check_le1, NULL }; static v_check posts_th[] = { check_ge2, check_le5, post_TH, NULL }; static v_check posts_uc[] = { post_UC, NULL }; -static v_check pres_bline[] = { check_bline, NULL }; -static v_check pres_sec[] = { check_bline, pre_sec, NULL}; +static v_check pres_sec[] = { pre_sec, NULL }; static const struct man_valid man_valids[MAN_MAX] = { { NULL, posts_br }, /* br */ - { pres_bline, posts_th }, /* TH */ + { NULL, posts_th }, /* TH */ { pres_sec, posts_sec }, /* SH */ { pres_sec, posts_sec }, /* SS */ - { pres_bline, NULL }, /* TP */ - { pres_bline, posts_par }, /* LP */ - { pres_bline, posts_par }, /* PP */ - { pres_bline, posts_par }, /* P */ - { pres_bline, NULL }, /* IP */ - { pres_bline, NULL }, /* HP */ + { NULL, NULL }, /* TP */ + { NULL, posts_par }, /* LP */ + { NULL, posts_par }, /* PP */ + { NULL, posts_par }, /* P */ + { NULL, NULL }, /* IP */ + { NULL, NULL }, /* HP */ { NULL, NULL }, /* SM */ { NULL, NULL }, /* SB */ { NULL, NULL }, /* BI */ @@ -99,8 +97,8 @@ static const struct man_valid man_valids[MAN_MAX] = { { NULL, NULL }, /* RI */ { NULL, posts_eq0 }, /* na */ /* FIXME: should warn only. */ { NULL, posts_sp }, /* sp */ /* FIXME: should warn only. */ - { pres_bline, posts_nf }, /* nf */ - { pres_bline, posts_fi }, /* fi */ + { NULL, posts_nf }, /* nf */ + { NULL, posts_fi }, /* fi */ { NULL, NULL }, /* RE */ { NULL, posts_part }, /* RS */ { NULL, NULL }, /* DT */ @@ -348,19 +346,6 @@ check_par(CHKARGS) static int -check_bline(CHKARGS) -{ - - assert( ! (MAN_ELINE & m->flags)); - if (MAN_BLINE & m->flags) { - man_nmsg(m, n, MANDOCERR_SYNTLINESCOPE); - return(0); - } - - return(1); -} - -static int post_TH(CHKARGS) { const char *p; |