tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
* 1.11.7 regression: bold and underlined hyphens
@ 2011-09-18 20:34 Ingo Schwarze
  2011-09-18 20:47 ` Kristaps Dzonsons
  0 siblings, 1 reply; 2+ messages in thread
From: Ingo Schwarze @ 2011-09-18 20:34 UTC (permalink / raw)
  To: tech

CVSROOT:	/cvs
Module name:	src
Changes by:	schwarze@cvs.openbsd.org	2011/09/18 14:38:02

Modified files:
	usr.bin/mandoc : term.c 

Log message:
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.


OK to commit to bsd.lv as well?
  Ingo


Index: term.c
===================================================================
RCS file: /cvs/src/usr.bin/mandoc/term.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -p -r1.59 -r1.60
--- term.c	29 May 2011 21:22:18 -0000	1.59
+++ term.c	18 Sep 2011 20:38:02 -0000	1.60
@@ -572,13 +572,16 @@ encode(struct termp *p, const char *word
 		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];
 
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: 1.11.7 regression: bold and underlined hyphens
  2011-09-18 20:34 1.11.7 regression: bold and underlined hyphens Ingo Schwarze
@ 2011-09-18 20:47 ` Kristaps Dzonsons
  0 siblings, 0 replies; 2+ messages in thread
From: Kristaps Dzonsons @ 2011-09-18 20:47 UTC (permalink / raw)
  To: tech; +Cc: Ingo Schwarze

On 18/09/2011 22:34, Ingo Schwarze wrote:
> CVSROOT:	/cvs
> Module name:	src
> Changes by:	schwarze@cvs.openbsd.org	2011/09/18 14:38:02
>
> Modified files:
> 	usr.bin/mandoc : term.c
>
> Log message:
> 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.
>
>
> OK to commit to bsd.lv as well?

Ok kristaps!
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-09-18 20:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-18 20:34 1.11.7 regression: bold and underlined hyphens Ingo Schwarze
2011-09-18 20:47 ` Kristaps Dzonsons

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).