=================================================================== RCS file: /cvs/mandoc/man_term.c,v retrieving revision 1.118 retrieving revision 1.121 diff -u -p -r1.118 -r1.121 --- mandoc/man_term.c 2011/09/20 09:02:23 1.118 +++ mandoc/man_term.c 2011/09/21 09:57:13 1.121 @@ -1,4 +1,4 @@ -/* $Id: man_term.c,v 1.118 2011/09/20 09:02:23 schwarze Exp $ */ +/* $Id: man_term.c,v 1.121 2011/09/21 09:57:13 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2011 Ingo Schwarze @@ -251,7 +251,7 @@ pre_literal(DECL_ARGS) * indentation has to be set up explicitly. */ if (MAN_HP == n->parent->tok && p->rmargin < p->maxrmargin) { - p->offset = p->rmargin + 1; + p->offset = p->rmargin; p->rmargin = p->maxrmargin; p->flags &= ~(TERMP_NOBREAK | TERMP_TWOSPACE); p->flags |= TERMP_NOSPACE; @@ -469,9 +469,7 @@ pre_HP(DECL_ARGS) len = (size_t)ival; one = term_len(p, 1); - if (len > one) - len -= one; - else + if (len < one) len = one; p->offset = mt->offset; @@ -640,7 +638,7 @@ pre_TP(DECL_ARGS) /* Calculate offset. */ if (NULL != (nn = n->parent->head->child)) - if (nn->parent->line == nn->line) + if (nn->string && nn->parent->line == nn->line) if ((ival = a2width(p, nn->string)) >= 0) len = (size_t)ival; @@ -826,7 +824,8 @@ pre_RS(DECL_ARGS) sz = (size_t)ival; mt->offset += sz; - p->offset = mt->offset; + p->rmargin = p->maxrmargin; + p->offset = mt->offset < p->rmargin ? mt->offset : p->rmargin; if (++mt->lmarginsz < MAXMARGINS) mt->lmargincur = mt->lmarginsz;