tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
* [PATCH] unbreak special characters in the header
@ 2010-06-10 23:06 Ingo Schwarze
  2010-06-10 23:12 ` Kristaps Dzonsons
  0 siblings, 1 reply; 2+ messages in thread
From: Ingo Schwarze @ 2010-06-10 23:06 UTC (permalink / raw)
  To: tech

Hi,

testing initial -Tps support in OpenBSD, mandoc segfaulted in
/usr/src/usr.sbin/bind/bin/check/named-checkconf.8, which has
.TH "NAMED\-CHECKCONF" "8" "June 14, 2000" "BIND9" "BIND9"

Thus, i committed -Tps together with the following patch:
It is not a good idea to to print the header before setting
up the character tables.

While here, set p->tabwidth in terminal_man() for symmetry
with terminal_mdoc(), as suggested by millert@ (and already
committed to OpenBSD earlier).   Since 5 is the default, this
is not strictly required, but it is certainly clearer and more
robust.

OK to commit to bsd.lv, too?

Yours,
  Ingo


--- mdocml/man_term.c	Fri Jun 11 00:41:37 2010
+++ mandoc/man_term.c	Fri Jun 11 00:50:10 2010
@@ -158,9 +154,8 @@ terminal_man(void *arg, const struct man *man)
 
 	p->overstep = 0;
 	p->maxrmargin = p->defrmargin;
+	p->tabwidth = 5;
 
-	term_begin(p, print_man_head, print_man_foot, man_meta(man));
-
 	if (NULL == p->symtab)
 		switch (p->enc) {
 		case (TERMENC_ASCII):
@@ -174,6 +169,7 @@ terminal_man(void *arg, const struct man *man)
 	n = man_node(man);
 	m = man_meta(man);
 
+	term_begin(p, print_man_head, print_man_foot, m);
 	p->flags |= TERMP_NOSPACE;
 
 	mt.fl = 0;
--- mdocml/mdoc_term.c	Fri Jun 11 00:41:37 2010
+++ mandoc/mdoc_term.c	Fri Jun 11 00:50:10 2010
@@ -276,9 +272,6 @@ terminal_mdoc(void *arg, const struct mdoc *mdoc)
 	p->maxrmargin = p->defrmargin;
 	p->tabwidth = 5;
 
-	term_begin(p, print_mdoc_head, 
-			print_mdoc_foot, mdoc_meta(mdoc));
-
 	if (NULL == p->symtab)
 		switch (p->enc) {
 		case (TERMENC_ASCII):
@@ -291,6 +284,8 @@ terminal_mdoc(void *arg, const struct mdoc *mdoc)
 
 	n = mdoc_node(mdoc);
 	m = mdoc_meta(mdoc);
+
+	term_begin(p, print_mdoc_head, print_mdoc_foot, m);
 
 	if (n->child)
 		print_mdoc_nodelist(p, NULL, m, n->child);
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

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

* Re: [PATCH] unbreak special characters in the header
  2010-06-10 23:06 [PATCH] unbreak special characters in the header Ingo Schwarze
@ 2010-06-10 23:12 ` Kristaps Dzonsons
  0 siblings, 0 replies; 2+ messages in thread
From: Kristaps Dzonsons @ 2010-06-10 23:12 UTC (permalink / raw)
  To: tech

> testing initial -Tps support in OpenBSD, mandoc segfaulted in
> /usr/src/usr.sbin/bind/bin/check/named-checkconf.8, which has
> .TH "NAMED\-CHECKCONF" "8" "June 14, 2000" "BIND9" "BIND9"
> 
> Thus, i committed -Tps together with the following patch:
> It is not a good idea to to print the header before setting
> up the character tables.
> 
> While here, set p->tabwidth in terminal_man() for symmetry
> with terminal_mdoc(), as suggested by millert@ (and already
> committed to OpenBSD earlier).   Since 5 is the default, this
> is not strictly required, but it is certainly clearer and more
> robust.
> 
> OK to commit to bsd.lv, too?

That looks fine.

Incidentally, I'll be away from all communique until Sunday...

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:[~2010-06-10 23:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-10 23:06 [PATCH] unbreak special characters in the header Ingo Schwarze
2010-06-10 23:12 ` 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).