=================================================================== RCS file: /cvs/mandoc/man_term.c,v retrieving revision 1.47 retrieving revision 1.51 diff -u -p -r1.47 -r1.51 --- mandoc/man_term.c 2009/10/30 18:53:08 1.47 +++ mandoc/man_term.c 2009/11/10 12:03:30 1.51 @@ -1,4 +1,4 @@ -/* $Id: man_term.c,v 1.47 2009/10/30 18:53:08 kristaps Exp $ */ +/* $Id: man_term.c,v 1.51 2009/11/10 12:03:30 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -85,7 +85,6 @@ static int pre_BI(DECL_ARGS); static int pre_HP(DECL_ARGS); static int pre_I(DECL_ARGS); static int pre_IP(DECL_ARGS); -static int pre_IR(DECL_ARGS); static int pre_PP(DECL_ARGS); static int pre_RB(DECL_ARGS); static int pre_RI(DECL_ARGS); @@ -130,7 +129,7 @@ static const struct termact termacts[MAN_MAX] = { { NULL, NULL }, /* R */ { pre_B, post_B }, /* B */ { pre_I, post_I }, /* I */ - { pre_IR, NULL }, /* IR */ + { pre_RI, NULL }, /* IR */ { pre_RI, NULL }, /* RI */ { NULL, NULL }, /* na */ { pre_I, post_i }, /* i */ @@ -299,26 +298,6 @@ pre_nf(DECL_ARGS) /* ARGSUSED */ static int -pre_IR(DECL_ARGS) -{ - const struct man_node *nn; - int i; - - for (i = 0, nn = n->child; nn; nn = nn->next, i++) { - if ( ! (i % 2)) - p->under++; - if (i > 0) - p->flags |= TERMP_NOSPACE; - print_man_node(p, mt, nn, m); - if ( ! (i % 2)) - p->under--; - } - return(0); -} - - -/* ARGSUSED */ -static int pre_RB(DECL_ARGS) { const struct man_node *nn; @@ -352,13 +331,19 @@ pre_RI(DECL_ARGS) int i; for (i = 0, nn = n->child; nn; nn = nn->next, i++) { - if ( ! (i % 2)) + if (i % 2 && MAN_RI == n->tok) p->under++; + else if ( ! (i % 2) && MAN_RI != n->tok) + p->under++; + if (i > 0) p->flags |= TERMP_NOSPACE; print_man_node(p, mt, nn, m); - if ( ! (i % 2)) + + if (i % 2 && MAN_RI == n->tok) p->under--; + else if ( ! (i % 2) && MAN_RI != n->tok) + p->under--; } return(0); } @@ -891,9 +876,13 @@ print_man_node(DECL_ARGS) if (c && n->child) print_man_body(p, mt, n->child, m); - if (MAN_TEXT != n->type) + if (MAN_TEXT != n->type) { if (termacts[n->tok].post) (*termacts[n->tok].post)(p, mt, n, m); + + /* Reset metafont upon exit from macro. */ + p->metafont = 0; + } } @@ -912,6 +901,8 @@ static void print_man_foot(struct termp *p, const struct man_meta *meta) { char buf[DATESIZ]; + + p->metafont = 0; time2a(meta->date, buf, DATESIZ);