=================================================================== RCS file: /cvs/mandoc/term.c,v retrieving revision 1.101 retrieving revision 1.104 diff -u -p -r1.101 -r1.104 --- mandoc/term.c 2009/09/17 07:41:28 1.101 +++ mandoc/term.c 2009/10/10 11:05:23 1.104 @@ -1,4 +1,4 @@ -/* $Id: term.c,v 1.101 2009/09/17 07:41:28 kristaps Exp $ */ +/* $Id: term.c,v 1.104 2009/10/10 11:05:23 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -25,6 +25,9 @@ #include "man.h" #include "mdoc.h" +/* FIXME: accomodate non-breaking, non-collapsing white-space. */ +/* FIXME: accomodate non-breaking, collapsing white-space. */ + extern void man_run(struct termp *, const struct man *); extern void mdoc_run(struct termp *, @@ -90,7 +93,7 @@ term_free(struct termp *p) if (p->buf) free(p->buf); - if (TERMENC_ASCII == p->enc && p->symtab) + if (p->symtab) chars_free(p->symtab); free(p); @@ -156,7 +159,7 @@ void term_flushln(struct termp *p) { int i, j; - size_t vbl, vsz, vis, maxvis, mmax, bp; + size_t vbl, vsz, vis, maxvis, mmax, bp, os; static int overstep = 0; /* @@ -169,6 +172,9 @@ term_flushln(struct termp *p) assert(p->offset < p->rmargin); assert((int)(p->rmargin - p->offset) - overstep > 0); + /* Save the overstep. */ + os = (size_t)overstep; + maxvis = /* LINTED */ p->rmargin - p->offset - overstep; mmax = /* LINTED */ @@ -230,6 +236,9 @@ term_flushln(struct termp *p) putchar(' '); vis = 0; } + /* Remove the overstep width. */ + bp += os; + os = 0; } else { for (j = 0; j < (int)vbl; j++) putchar(' ');