summaryrefslogtreecommitdiffstatshomepage
path: root/man_term.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-11-05 08:39:36 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-11-05 08:39:36 +0000
commitcb156f15852e81dc6e6cda189a91729f275f6c46 (patch)
tree277840f4965bce376e35d25ca20df13abd4a8f9a /man_term.c
parentde8a120741d506eaa296f9331b186d2971521eb8 (diff)
downloadmandoc-cb156f15852e81dc6e6cda189a91729f275f6c46.tar.gz
mandoc-cb156f15852e81dc6e6cda189a91729f275f6c46.tar.zst
mandoc-cb156f15852e81dc6e6cda189a91729f275f6c46.zip
Consolidated `RI' and `IR' handlers (-man -Tascii).
Diffstat (limited to 'man_term.c')
-rw-r--r--man_term.c35
1 files changed, 10 insertions, 25 deletions
diff --git a/man_term.c b/man_term.c
index cc823abe..c400d91c 100644
--- a/man_term.c
+++ b/man_term.c
@@ -1,4 +1,4 @@
-/* $Id: man_term.c,v 1.48 2009/11/05 08:37:12 kristaps Exp $ */
+/* $Id: man_term.c,v 1.49 2009/11/05 08:39:36 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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,12 +331,18 @@ 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);