-/* $Id: term.c,v 1.171 2010/09/15 14:36:16 kristaps Exp $ */
+/* $Id: term.c,v 1.172 2010/09/23 20:26:00 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
size_t vbl; /* number of blanks to prepend to output */
size_t vend; /* end of word visual position on output */
size_t bp; /* visual right border position */
+ size_t dv; /* temporary for visual pos calculations */
int j; /* temporary loop index for p->buf */
int jhy; /* last hyph before overflow w/r/t j */
size_t maxvis; /* output position of visible boundary */
j = i;
while (' ' == p->buf[i])
i++;
- vbl += (i - j) * (*p->width)(p, ' ');
+ dv = (i - j) * (*p->width)(p, ' ');
+ vbl += dv;
+ vend += dv;
break;
}
if (ASCII_NBRSP == p->buf[i]) {
p->viscol += (*p->width)(p, p->buf[i]);
}
}
- vend += vbl;
vis = vend;
}