From 92b3eb176fd08cfee644b6d273ae41dd12c0236c Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sun, 18 Sep 2011 20:38:03 +0000 Subject: 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. --- usr.bin/mandoc/term.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'usr.bin/mandoc') 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 * Copyright (c) 2010, 2011 Ingo Schwarze @@ -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]; -- cgit v1.2.3