diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2015-04-04 11:43:54 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2015-04-04 11:43:54 +0000 |
commit | dad7c5cadaecadd557fe3b1bb702f7ec544b7fef (patch) | |
tree | c51e24b269b50b8be90ebfba6da684130299fd5f /usr.bin/mandoc/man_term.c | |
parent | 38bc39e549b0c81b331434b77d2d88d38105392e (diff) |
Fix a quirk with respect to empty .HP.
Found while writing a regression test for man_macro.c rev. 1.66.
Incidentally, this brings rendering of XFreeEventData(3) closer to groff.
Diffstat (limited to 'usr.bin/mandoc/man_term.c')
-rw-r--r-- | usr.bin/mandoc/man_term.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/usr.bin/mandoc/man_term.c b/usr.bin/mandoc/man_term.c index 131d552344b..1314cd519a5 100644 --- a/usr.bin/mandoc/man_term.c +++ b/usr.bin/mandoc/man_term.c @@ -1,4 +1,4 @@ -/* $OpenBSD: man_term.c,v 1.126 2015/04/02 23:47:43 schwarze Exp $ */ +/* $OpenBSD: man_term.c,v 1.127 2015/04/04 11:43:53 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org> @@ -531,6 +531,17 @@ post_HP(DECL_ARGS) switch (n->type) { case ROFFT_BODY: term_newln(p); + + /* + * Compatibility with a groff bug. + * The .HP macro uses the undocumented .tag request + * which causes a line break and cancels no-space + * mode even if there isn't any output. + */ + + if (n->child == NULL) + term_vspace(p); + p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND); p->trailspace = 0; p->offset = mt->offset; |