=================================================================== RCS file: /cvs/mandoc/term.c,v retrieving revision 1.86 retrieving revision 1.89 diff -u -p -r1.86 -r1.89 --- mandoc/term.c 2009/07/15 15:37:48 1.86 +++ mandoc/term.c 2009/07/16 13:17:51 1.89 @@ -1,4 +1,4 @@ -/* $Id: term.c,v 1.86 2009/07/15 15:37:48 kristaps Exp $ */ +/* $Id: term.c,v 1.89 2009/07/16 13:17:51 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -252,10 +252,10 @@ term_flushln(struct termp *p) /* LINTED */ for (j = i, vsz = 0; j < (int)p->col; j++) { - if (' ' == p->buf[j]) + if (' ' == p->buf[j]) break; else if (8 == p->buf[j]) - j += 1; + vsz--; else vsz++; } @@ -495,8 +495,8 @@ term_pescape(struct termp *p, const char **word) void term_word(struct termp *p, const char *word) { + const char *sv; - assert(*word); if (term_isclosedelim(word)) if ( ! (TERMP_IGNDELIM & p->flags)) p->flags |= TERMP_NOSPACE; @@ -512,13 +512,13 @@ term_word(struct termp *p, const char *word) * before the word. */ - for ( ; *word; word++) + for (sv = word; *word; word++) if ('\\' != *word) term_encodea(p, *word); else term_pescape(p, &word); - if (term_isopendelim(word)) + if (term_isopendelim(sv)) p->flags |= TERMP_NOSPACE; } @@ -549,8 +549,8 @@ term_chara(struct termp *p, char c) static void term_encodea(struct termp *p, char c) { - - if (TERMP_STYLE & p->flags) { + + if (' ' != c && TERMP_STYLE & p->flags) { if (TERMP_BOLD & p->flags) { term_chara(p, c); term_chara(p, 8);