From a5c677ee3a4424a0bf941147a939dc444d3849cb Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sat, 4 Apr 2015 11:44:43 +0000 Subject: 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. --- man_term.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/man_term.c b/man_term.c index 0404731a..8272456c 100644 --- a/man_term.c +++ b/man_term.c @@ -1,4 +1,4 @@ -/* $Id: man_term.c,v 1.173 2015/04/02 23:48:19 schwarze Exp $ */ +/* $Id: man_term.c,v 1.174 2015/04/04 11:44:43 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2015 Ingo Schwarze @@ -533,6 +533,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; -- cgit v1.2.3-56-ge451