=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/term.c,v retrieving revision 1.77 retrieving revision 1.78 diff -u -r1.77 -r1.78 --- src/usr.bin/mandoc/term.c 2014/01/22 20:58:35 1.77 +++ src/usr.bin/mandoc/term.c 2014/03/13 19:23:11 1.78 @@ -1,4 +1,4 @@ -/* $Id: term.c,v 1.77 2014/01/22 20:58:35 schwarze Exp $ */ +/* $Id: term.c,v 1.78 2014/03/13 19:23:11 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010-2014 Ingo Schwarze @@ -179,6 +179,13 @@ ASCII_BREAK == p->buf[j])) jhy = j; + /* + * Hyphenation now decided, put back a real + * hyphen such that we get the correct width. + */ + if (ASCII_HYPH == p->buf[j]) + p->buf[j] = '-'; + vend += (*p->width)(p, p->buf[j]); } @@ -242,12 +249,6 @@ (*p->advance)(p, vbl); p->viscol += vbl; vbl = 0; - } - - if (ASCII_HYPH == p->buf[i]) { - (*p->letter)(p, '-'); - p->viscol += (*p->width)(p, '-'); - continue; } (*p->letter)(p, p->buf[i]);