=================================================================== RCS file: /cvs/mandoc/term.c,v retrieving revision 1.213 retrieving revision 1.214 diff -u -p -r1.213 -r1.214 --- mandoc/term.c 2013/12/24 23:04:36 1.213 +++ mandoc/term.c 2013/12/25 00:39:31 1.214 @@ -1,4 +1,4 @@ -/* $Id: term.c,v 1.213 2013/12/24 23:04:36 schwarze Exp $ */ +/* $Id: term.c,v 1.214 2013/12/25 00:39:31 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2011, 2012, 2013 Ingo Schwarze @@ -407,6 +407,7 @@ term_fontpop(struct termp *p) void term_word(struct termp *p, const char *word) { + const char nbrsp[2] = { ASCII_NBRSP, 0 }; const char *seq, *cp; char c; int sz, uc; @@ -438,7 +439,15 @@ term_word(struct termp *p, const char *word) word++; continue; } - ssz = strcspn(word, "\\"); + if (TERMP_NBRWORD & p->flags) { + if (' ' == *word) { + encode(p, nbrsp, 1); + word++; + continue; + } + ssz = strcspn(word, "\\ "); + } else + ssz = strcspn(word, "\\"); encode(p, word, ssz); word += (int)ssz; continue; @@ -513,6 +522,7 @@ term_word(struct termp *p, const char *word) break; } } + p->flags &= ~TERMP_NBRWORD; } static void