summaryrefslogtreecommitdiffstats
path: root/term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2012-11-16 17:16:55 +0000
committerIngo Schwarze <schwarze@openbsd.org>2012-11-16 17:16:55 +0000
commitf514b64edd2431e2accb9fd52736b10c0c718f6c (patch)
tree4711062fa350c143a9c9808451a6f77175a16536 /term.c
parentc070642807053876d10f7d2e6a1e090eee114928 (diff)
downloadmandoc-f514b64edd2431e2accb9fd52736b10c0c718f6c.tar.gz
Improve formatting of badly nested font blocks.
The basic idea is to already pop the font at the end marker instead of allowing it to linger until the final end of the block. This requires a few preliminaries: * For each block, save a pointer to the previous font to be used in case the block breaks another and gets extended. * That requires making node information writable during rendering. * Now fonts may get popped in the wrong order; hence, after the stack has already been rewound further by some block that began earlier, ignore popping a font that was put on the stack later. * To be able to exploit all this for font blocks, tie processing to their body, not their block, which is more logical anyway. Triggered by florian@ reporting vaguely similar issues with list blocks.
Diffstat (limited to 'term.c')
-rw-r--r--term.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/term.c b/term.c
index 9e28f29c..c59d13df 100644
--- a/term.c
+++ b/term.c
@@ -376,7 +376,7 @@ void
term_fontpopq(struct termp *p, const void *key)
{
- while (p->fonti >= 0 && key != &p->fontq[p->fonti])
+ while (p->fonti >= 0 && key < (void *)(p->fontq + p->fonti))
p->fonti--;
assert(p->fonti >= 0);
}