summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/mandoc')
-rw-r--r--usr.bin/mandoc/term.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/mandoc/term.c b/usr.bin/mandoc/term.c
index 863e0a7a602..b29f9a4f2f6 100644
--- a/usr.bin/mandoc/term.c
+++ b/usr.bin/mandoc/term.c
@@ -1,4 +1,4 @@
-/* $Id: term.c,v 1.59 2011/05/29 21:22:18 schwarze Exp $ */
+/* $Id: term.c,v 1.60 2011/09/18 20:38:02 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -572,13 +572,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];