diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-07-25 22:56:47 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-07-25 22:56:47 +0000 |
commit | ba712caff7d1aa6bfad5031d345326df32dc101c (patch) | |
tree | 3aa8237d8ea02eabc55bc646de61e6e8dc936e0a | |
parent | c32c9b54af798951d53f0b265d9827723c718ced (diff) | |
download | mandoc-ba712caff7d1aa6bfad5031d345326df32dc101c.tar.gz |
Avoid running the "width" termp callback for each whitespace.
-rw-r--r-- | term.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -242,10 +242,10 @@ term_flushln(struct termp *p) if ('\t' == p->buf[i]) break; if (' ' == p->buf[i]) { - while (' ' == p->buf[i]) { - vbl += (*p->width)(p, p->buf[i]); + j = i; + while (' ' == p->buf[i]) i++; - } + vbl += (i - j) * (*p->width)(p, ' '); break; } if (ASCII_NBRSP == p->buf[i]) { |