summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2011-09-18 20:38:03 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2011-09-18 20:38:03 +0000
commit92b3eb176fd08cfee644b6d273ae41dd12c0236c (patch)
tree6332f018f8ade4a31889ab40d2c3738f2079007c /usr.bin/mandoc
parent1776bb57502de09fbe49afba1ccdfc501f028a15 (diff)
fix a regression introduced in 1.11.7:
even a breakable hyphen may be bold or underlined With this fix, 1.11.7 reduces the groff/mandoc differences in base by about 10% (100k -> 90k lines of diffs) with respect to 1.11.5.
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];