=================================================================== RCS file: /cvs/mandoc/term.c,v retrieving revision 1.149 retrieving revision 1.152 diff -u -p -r1.149 -r1.152 --- mandoc/term.c 2010/06/25 18:53:14 1.149 +++ mandoc/term.c 2010/06/28 09:48:44 1.152 @@ -1,4 +1,4 @@ -/* $Id: term.c,v 1.149 2010/06/25 18:53:14 kristaps Exp $ */ +/* $Id: term.c,v 1.152 2010/06/28 09:48:44 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -31,8 +31,6 @@ #include "chars.h" #include "out.h" #include "term.h" -#include "man.h" -#include "mdoc.h" #include "main.h" static void spec(struct termp *, const char *, size_t); @@ -135,9 +133,10 @@ term_flushln(struct termp *p) 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 */ - int j; /* temporary loop index */ - int jhy; /* last hyphen before line overflow */ - size_t maxvis, mmax; + 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 */ + size_t mmax; /* used in calculating bp */ /* * First, establish the maximum columns of "visible" content. @@ -482,9 +481,14 @@ term_word(struct termp *p, const char *word) } if ( ! (TERMP_NOSPACE & p->flags)) { - bufferc(p, ' '); - if (TERMP_SENTENCE & p->flags) + if ( ! (TERMP_KEEP & p->flags)) { + if (TERMP_PREKEEP & p->flags) + p->flags |= TERMP_KEEP; bufferc(p, ' '); + if (TERMP_SENTENCE & p->flags) + bufferc(p, ' '); + } else + bufferc(p, ASCII_NBRSP); } if ( ! (p->flags & TERMP_NONOSPACE))