From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from krisdoz.my.domain (schwarze@localhost [127.0.0.1]) by krisdoz.my.domain (8.14.5/8.14.5) with ESMTP id s2DJNpuN031173 for ; Thu, 13 Mar 2014 15:23:51 -0400 (EDT) Received: (from schwarze@localhost) by krisdoz.my.domain (8.14.5/8.14.3/Submit) id s2DJNpu6016414; Thu, 13 Mar 2014 15:23:51 -0400 (EDT) Date: Thu, 13 Mar 2014 15:23:51 -0400 (EDT) Message-Id: <201403131923.s2DJNpu6016414@krisdoz.my.domain> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: In -Tutf8 mode, make sure that hyphens get counted against the X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- In -Tutf8 mode, make sure that hyphens get counted against the output line length even when they are breakable. Before this, a line containing N breakable hyphens could get up to N characters wider than the right margin in -Tutf8 output mode. Issue reported by tedu@ on . Modified Files: -------------- mdocml: term.c Revision Data ------------- Index: term.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/term.c,v retrieving revision 1.216 retrieving revision 1.217 diff -Lterm.c -Lterm.c -u -p -r1.216 -r1.217 --- term.c +++ term.c @@ -183,6 +183,13 @@ term_flushln(struct termp *p) 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]); } @@ -246,12 +253,6 @@ term_flushln(struct termp *p) (*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]); -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv