=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/man_term.c,v retrieving revision 1.117 retrieving revision 1.118 diff -c -r1.117 -r1.118 *** src/usr.bin/mandoc/man_term.c 2014/12/24 09:57:41 1.117 --- src/usr.bin/mandoc/man_term.c 2014/12/24 18:03:34 1.118 *************** *** 1,4 **** ! /* $OpenBSD: man_term.c,v 1.117 2014/12/24 09:57:41 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2014 Ingo Schwarze --- 1,4 ---- ! /* $OpenBSD: man_term.c,v 1.118 2014/12/24 18:03:34 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2014 Ingo Schwarze *************** *** 45,51 **** #define DECL_ARGS struct termp *p, \ struct mtermp *mt, \ ! const struct man_node *n, \ const struct man_meta *meta struct termact { --- 45,51 ---- #define DECL_ARGS struct termp *p, \ struct mtermp *mt, \ ! struct man_node *n, \ const struct man_meta *meta struct termact { *************** *** 278,284 **** pre_alternate(DECL_ARGS) { enum termfont font[2]; ! const struct man_node *nn; int savelit, i; switch (n->tok) { --- 278,284 ---- pre_alternate(DECL_ARGS) { enum termfont font[2]; ! struct man_node *nn; int savelit, i; switch (n->tok) { *************** *** 641,647 **** pre_TP(DECL_ARGS) { struct roffsu su; ! const struct man_node *nn; int len, savelit; switch (n->type) { --- 641,647 ---- pre_TP(DECL_ARGS) { struct roffsu su; ! struct man_node *nn; int len, savelit; switch (n->type) { *************** *** 838,844 **** pre_RS(DECL_ARGS) { struct roffsu su; - int len; switch (n->type) { case MAN_BLOCK: --- 838,843 ---- *************** *** 850,866 **** break; } ! len = SHRT_MAX + 1; ! if ((n = n->parent->head->child) != NULL && ! a2roffsu(n->string, &su, SCALE_EN)) ! len = term_hspan(p, &su); ! if (len > SHRT_MAX) ! len = term_len(p, p->defindent); ! if (len > 0 || (size_t)(-len) < mt->offset) ! mt->offset += len; ! else ! mt->offset = 0; p->offset = mt->offset; p->rmargin = p->maxrmargin; --- 849,864 ---- break; } ! n = n->parent->head; ! n->aux = SHRT_MAX + 1; ! if (n->child != NULL && a2roffsu(n->child->string, &su, SCALE_EN)) ! n->aux = term_hspan(p, &su); ! if (n->aux < 0 && (size_t)(-n->aux) > mt->offset) ! n->aux = -mt->offset; ! else if (n->aux > SHRT_MAX) ! n->aux = term_len(p, p->defindent); ! mt->offset += n->aux; p->offset = mt->offset; p->rmargin = p->maxrmargin; *************** *** 874,881 **** static void post_RS(DECL_ARGS) { - struct roffsu su; - int len; switch (n->type) { case MAN_BLOCK: --- 872,877 ---- *************** *** 887,903 **** break; } ! len = SHRT_MAX + 1; ! if ((n = n->parent->head->child) != NULL && ! a2roffsu(n->string, &su, SCALE_EN)) ! len = term_hspan(p, &su); ! if (len > SHRT_MAX) ! len = term_len(p, p->defindent); ! ! if (len < 0 || (size_t)len < mt->offset) ! mt->offset -= len; ! else ! mt->offset = 0; p->offset = mt->offset; if (--mt->lmarginsz < MAXMARGINS) --- 883,889 ---- break; } ! mt->offset -= n->parent->head->aux; p->offset = mt->offset; if (--mt->lmarginsz < MAXMARGINS)