summaryrefslogtreecommitdiffstats
path: root/term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2011-09-18 21:18:19 +0000
committerIngo Schwarze <schwarze@openbsd.org>2011-09-18 21:18:19 +0000
commitb9805b21686844285a66e361542127622df77b54 (patch)
treec806fea95c0bbe64f2bd916e8b1d47cd52819787 /term.c
parentc0cf1cf97e8172e517a1ef4d489d8479b588fe02 (diff)
downloadmandoc-b9805b21686844285a66e361542127622df77b54.tar.gz
fix a regression introduced in 1.11.7:
even a breakable hyphen may be bold or underlined ok kristaps@
Diffstat (limited to 'term.c')
-rw-r--r--term.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/term.c b/term.c
index a26907c4..aee5bfa9 100644
--- a/term.c
+++ b/term.c
@@ -576,13 +576,16 @@ encode(struct termp *p, const char *word, size_t sz)
adjbuf(p, p->col + 1 + (len * 3));
for (i = 0; i < len; i++) {
- if ( ! isgraph((unsigned char)word[i])) {
+ if (ASCII_HYPH != word[i] &&
+ ! isgraph((unsigned char)word[i])) {
p->buf[p->col++] = word[i];
continue;
}
if (TERMFONT_UNDER == f)
p->buf[p->col++] = '_';
+ else if (ASCII_HYPH == word[i])
+ p->buf[p->col++] = '-';
else
p->buf[p->col++] = word[i];