=================================================================== RCS file: /cvs/mandoc/term.c,v retrieving revision 1.166 retrieving revision 1.168 diff -u -p -r1.166 -r1.168 --- mandoc/term.c 2010/07/26 22:26:05 1.166 +++ mandoc/term.c 2010/08/20 23:22:09 1.168 @@ -1,4 +1,4 @@ -/* $Id: term.c,v 1.166 2010/07/26 22:26:05 kristaps Exp $ */ +/* $Id: term.c,v 1.168 2010/08/20 23:22:09 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * Copyright (c) 2010 Ingo Schwarze @@ -83,7 +83,7 @@ term_alloc(enum termenc enc) p = calloc(1, sizeof(struct termp)); if (NULL == p) { perror(NULL); - exit(EXIT_FAILURE); + exit(MANDOCLEVEL_SYSERR); } p->enc = enc; @@ -275,6 +275,12 @@ term_flushln(struct termp *p) vis = vend; } + /* + * If there was trailing white space, it was not printed; + * so reset the cursor position accordingly. + */ + vis -= vbl; + p->col = 0; p->overstep = 0; @@ -577,7 +583,7 @@ adjbuf(struct termp *p, size_t sz) p->buf = realloc(p->buf, p->maxcols); if (NULL == p->buf) { perror(NULL); - exit(EXIT_FAILURE); + exit(MANDOCLEVEL_SYSERR); } }