=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/term.c,v retrieving revision 1.25 retrieving revision 1.26 diff -c -r1.25 -r1.26 *** src/usr.bin/mandoc/term.c 2010/03/22 23:16:21 1.25 --- src/usr.bin/mandoc/term.c 2010/03/26 01:22:07 1.26 *************** *** 1,4 **** ! /* $Id: term.c,v 1.25 2010/03/22 23:16:21 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * --- 1,4 ---- ! /* $Id: term.c,v 1.26 2010/03/26 01:22:07 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * *************** *** 79,85 **** perror(NULL); exit(EXIT_FAILURE); } - p->maxrmargin = 78; p->enc = enc; return(p); } --- 79,84 ---- *************** *** 134,140 **** int jhy; /* last hyphen before line overflow */ size_t maxvis, mmax; static int line_started = 0; - static int overstep = 0; /* * First, establish the maximum columns of "visible" content. --- 133,138 ---- *************** *** 145,156 **** assert(p->offset < p->rmargin); ! maxvis = (int)(p->rmargin - p->offset) - overstep < 0 ? /* LINTED */ ! 0 : p->rmargin - p->offset - overstep; ! mmax = (int)(p->maxrmargin - p->offset) - overstep < 0 ? /* LINTED */ ! 0 : p->maxrmargin - p->offset - overstep; bp = TERMP_NOBREAK & p->flags ? mmax : maxvis; --- 143,154 ---- assert(p->offset < p->rmargin); ! maxvis = (int)(p->rmargin - p->offset) - p->overstep < 0 ? /* LINTED */ ! 0 : p->rmargin - p->offset - p->overstep; ! mmax = (int)(p->maxrmargin - p->offset) - p->overstep < 0 ? /* LINTED */ ! 0 : p->maxrmargin - p->offset - p->overstep; bp = TERMP_NOBREAK & p->flags ? mmax : maxvis; *************** *** 224,233 **** for (j = 0; j < (int)p->offset; j++) putchar(' '); } ! /* Remove the overstep width. */ bp += (int)/* LINTED */ ! overstep; ! overstep = 0; } else { for (j = 0; j < (int)vbl; j++) putchar(' '); --- 222,231 ---- for (j = 0; j < (int)p->offset; j++) putchar(' '); } ! /* Remove the p->overstep width. */ bp += (int)/* LINTED */ ! p->overstep; ! p->overstep = 0; } else { for (j = 0; j < (int)vbl; j++) putchar(' '); *************** *** 252,258 **** } p->col = 0; ! overstep = 0; if ( ! (TERMP_NOBREAK & p->flags)) { if (line_started) { --- 250,256 ---- } p->col = 0; ! p->overstep = 0; if ( ! (TERMP_NOBREAK & p->flags)) { if (line_started) { *************** *** 264,270 **** if (TERMP_HANG & p->flags) { /* We need one blank after the tag. */ ! overstep = /* LINTED */ vis - maxvis + 1; /* --- 262,268 ---- if (TERMP_HANG & p->flags) { /* We need one blank after the tag. */ ! p->overstep = /* LINTED */ vis - maxvis + 1; /* *************** *** 277,288 **** * move it one step LEFT and flag the rest of the line * to be longer. */ ! if (overstep >= -1) { ! assert((int)maxvis + overstep >= 0); /* LINTED */ ! maxvis += overstep; } else ! overstep = 0; } else if (TERMP_DANGLE & p->flags) return; --- 275,286 ---- * move it one step LEFT and flag the rest of the line * to be longer. */ ! if (p->overstep >= -1) { ! assert((int)maxvis + p->overstep >= 0); /* LINTED */ ! maxvis += p->overstep; } else ! p->overstep = 0; } else if (TERMP_DANGLE & p->flags) return;