=================================================================== RCS file: /cvs/mandoc/term.c,v retrieving revision 1.168 retrieving revision 1.169 diff -u -p -r1.168 -r1.169 --- mandoc/term.c 2010/08/20 23:22:09 1.168 +++ mandoc/term.c 2010/08/20 23:34:02 1.169 @@ -1,4 +1,4 @@ -/* $Id: term.c,v 1.168 2010/08/20 23:22:09 schwarze Exp $ */ +/* $Id: term.c,v 1.169 2010/08/20 23:34:02 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * Copyright (c) 2010 Ingo Schwarze @@ -169,12 +169,11 @@ term_flushln(struct termp *p) * Handle literal tab characters: collapse all * subsequent tabs into a single huge set of spaces. */ - for (j = i; j < (int)p->col; j++) { - if ('\t' != p->buf[j]) - break; + while (i < (int)p->col && '\t' == p->buf[i]) { vend = (vis / p->tabwidth + 1) * p->tabwidth; vbl += vend - vis; vis = vend; + i++; } /* @@ -185,7 +184,7 @@ term_flushln(struct termp *p) */ /* LINTED */ - for (jhy = 0; j < (int)p->col; j++) { + for (j = i, jhy = 0; j < (int)p->col; j++) { if ((j && ' ' == p->buf[j]) || '\t' == p->buf[j]) break; @@ -227,12 +226,6 @@ term_flushln(struct termp *p) p->overstep; p->overstep = 0; } - - /* - * Skip leading tabs, they were handled above. - */ - while (i < (int)p->col && '\t' == p->buf[i]) - i++; /* Write out the [remaining] word. */ for ( ; i < (int)p->col; i++) {