=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/man_term.c,v retrieving revision 1.186 retrieving revision 1.187 diff -c -r1.186 -r1.187 *** src/usr.bin/mandoc/man_term.c 2020/01/20 10:29:31 1.186 --- src/usr.bin/mandoc/man_term.c 2020/02/27 01:25:57 1.187 *************** *** 1,4 **** ! /* $OpenBSD: man_term.c,v 1.186 2020/01/20 10:29:31 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2015, 2017-2020 Ingo Schwarze --- 1,4 ---- ! /* $OpenBSD: man_term.c,v 1.187 2020/02/27 01:25:57 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2015, 2017-2020 Ingo Schwarze *************** *** 62,68 **** static void print_man_foot(struct termp *, const struct roff_meta *); static void print_bvspace(struct termp *, ! const struct roff_node *, int); static int pre_B(DECL_ARGS); static int pre_DT(DECL_ARGS); --- 62,68 ---- static void print_man_foot(struct termp *, const struct roff_meta *); static void print_bvspace(struct termp *, ! struct roff_node *, int); static int pre_B(DECL_ARGS); static int pre_DT(DECL_ARGS); *************** *** 203,221 **** * first, print it. */ static void ! print_bvspace(struct termp *p, const struct roff_node *n, int pardist) { ! int i; term_newln(p); ! if (n->body != NULL && n->body->child != NULL) ! if (n->body->child->type == ROFFT_TBL) ! return; ! if (n->parent->type == ROFFT_ROOT || n->parent->tok != MAN_RS) ! if (n->prev == NULL) ! return; for (i = 0; i < pardist; i++) term_vspace(p); --- 203,222 ---- * first, print it. */ static void ! print_bvspace(struct termp *p, struct roff_node *n, int pardist) { ! struct roff_node *nch; ! int i; term_newln(p); ! if (n->body != NULL && ! (nch = roff_node_child(n->body)) != NULL && ! nch->type == ROFFT_TBL) ! return; ! if (n->parent->tok != MAN_RS && roff_node_prev(n) == NULL) ! return; for (i = 0; i < pardist; i++) term_vspace(p); *************** *** 681,692 **** * and after an empty subsection. */ ! do { ! n = n->prev; ! } while (n != NULL && n->tok >= MAN_TH && ! man_term_act(n->tok)->flags & MAN_NOTEXT); ! if (n == NULL || n->type == ROFFT_COMMENT || ! (n->tok == MAN_SS && n->body->child == NULL)) break; for (i = 0; i < mt->pardist; i++) --- 682,689 ---- * and after an empty subsection. */ ! if ((n = roff_node_prev(n)) == NULL || ! (n->tok == MAN_SS && roff_node_child(n->body) == NULL)) break; for (i = 0; i < mt->pardist; i++) *************** *** 726,737 **** * and after an empty section. */ ! do { ! n = n->prev; ! } while (n != NULL && n->tok >= MAN_TH && ! man_term_act(n->tok)->flags & MAN_NOTEXT); ! if (n == NULL || n->type == ROFFT_COMMENT || ! (n->tok == MAN_SH && n->body->child == NULL)) break; for (i = 0; i < mt->pardist; i++) --- 723,730 ---- * and after an empty section. */ ! if ((n = roff_node_prev(n)) == NULL || ! (n->tok == MAN_SH && roff_node_child(n->body) == NULL)) break; for (i = 0; i < mt->pardist; i++) *************** *** 837,843 **** switch (n->type) { case ROFFT_BLOCK: ! if (n->prev == NULL || n->prev->tok != MAN_SY) print_bvspace(p, n, mt->pardist); return 1; case ROFFT_HEAD: --- 830,836 ---- switch (n->type) { case ROFFT_BLOCK: ! if ((nn = roff_node_prev(n)) == NULL || nn->tok != MAN_SY) print_bvspace(p, n, mt->pardist); return 1; case ROFFT_HEAD: