aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit28dc1d2e4d1a3234ff9bda014276f222295dbc35 (patch)
tree85e58197a05e2b02fe91870178b86e9c093cfda1 /term.c
parent0db0f1dcf41bba11b2c2fea958e421416dca4a4b (diff)
downloadmandoc-28dc1d2e4d1a3234ff9bda014276f222295dbc35.tar.gz
mandoc-28dc1d2e4d1a3234ff9bda014276f222295dbc35.tar.zst
mandoc-28dc1d2e4d1a3234ff9bda014276f222295dbc35.zip
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.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/term.c b/term.c
index 64ec9566..75efa106 100644
--- a/term.c
+++ b/term.c
@@ -1,4 +1,4 @@
-/* $Id: term.c,v 1.198 2011/09/18 14:14:15 schwarze Exp $ */
+/* $Id: term.c,v 1.199 2011/09/18 21:18:19 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -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];