=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mdoc_term.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- src/usr.bin/mandoc/mdoc_term.c 2009/07/18 17:11:44 1.27 +++ src/usr.bin/mandoc/mdoc_term.c 2009/07/18 17:26:21 1.28 @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.27 2009/07/18 17:11:44 schwarze Exp $ */ +/* $Id: mdoc_term.c,v 1.28 2009/07/18 17:26:21 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -82,9 +82,7 @@ struct termpair { struct termpair *ppair; - int flag; - size_t offset; /* Left margin. */ - size_t rmargin; /* Right margin. */ + int flag; int count; }; @@ -339,12 +337,13 @@ { int dochild; struct termpair npair; + size_t offset, rmargin; - /* Pre-processing. */ - dochild = 1; + offset = p->offset; + rmargin = p->rmargin; + npair.ppair = pair; - npair.offset = npair.rmargin = 0; npair.flag = 0; npair.count = 0; @@ -369,6 +368,9 @@ if (MDOC_TEXT != node->type) if (termacts[node->tok].post) (*termacts[node->tok].post)(p, &npair, meta, node); + + p->offset = offset; + p->rmargin = rmargin; } @@ -687,7 +689,7 @@ { const struct mdoc_node *bl, *n; char buf[7]; - int i, type, keys[3], vals[3], sv; + int i, type, keys[3], vals[3]; size_t width, offset; if (MDOC_BLOCK == node->type) @@ -697,8 +699,6 @@ /* Save parent attributes. */ - pair->offset = p->offset; - pair->rmargin = p->rmargin; pair->flag = p->flags; /* Get list width and offset. */ @@ -878,7 +878,6 @@ * HEAD character (temporarily bold, in some cases). */ - sv = p->flags; if (MDOC_HEAD == node->type) switch (type) { case (MDOC_Bullet): @@ -901,8 +900,6 @@ break; } - p->flags = sv; /* Restore saved flags. */ - /* * If we're not going to process our children, indicate so here. */ @@ -961,8 +958,6 @@ break; } - p->offset = pair->offset; - p->rmargin = pair->rmargin; p->flags = pair->flag; } @@ -1325,8 +1320,7 @@ if (MDOC_BLOCK != node->type) return(1); term_newln(p); - pair->offset = INDENT + 1; - p->offset += pair->offset; + p->offset += (INDENT + 1); return(1); } @@ -1339,7 +1333,6 @@ if (MDOC_BLOCK != node->type) return; term_newln(p); - p->offset -= pair->offset; } @@ -1508,8 +1501,6 @@ if (NULL == node->parent->args) errx(1, "missing display type"); - pair->offset = p->offset; - for (type = -1, i = 0; i < (int)node->parent->args->argc; i++) { switch (node->parent->args->argv[i].arg) { @@ -1579,7 +1570,6 @@ term_flushln(p); p->flags &= ~TERMP_LITERAL; - p->offset = pair->offset; p->flags |= TERMP_NOSPACE; }