summaryrefslogtreecommitdiffstats
path: root/roff.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-06-09 20:00:38 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-06-09 20:00:38 +0000
commitb33e04fa7bbe5f17c54a8a302bf93d8a56784800 (patch)
treecc3cee916735cd4add0ced0de0ca84c6a1255495 /roff.c
parentc92be367f7c707418fe2a4beb17688dffa614781 (diff)
downloadmandoc-b33e04fa7bbe5f17c54a8a302bf93d8a56784800.tar.gz
Make "sub" for conditionals run roffnode_cleanscope() before calling
down to sub-arguments. From a bug report by Ulrich Spoerlein.
Diffstat (limited to 'roff.c')
-rw-r--r--roff.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/roff.c b/roff.c
index f6c85c7a..a3a5b550 100644
--- a/roff.c
+++ b/roff.c
@@ -621,11 +621,21 @@ roff_cond_sub(ROFF_ARGS)
{
enum rofft t;
enum roffrule rr;
+ struct roffnode *l;
ppos = pos;
rr = r->last->rule;
- roff_cond_text(r, tok, bufp, szp, ln, ppos, pos, offs);
+ /*
+ * Clean out scope. If we've closed ourselves, then don't
+ * continue.
+ */
+
+ l = r->last;
+ roffnode_cleanscope(r);
+
+ if (l != r->last)
+ return(ROFFRULE_DENY == rr ? ROFF_IGN : ROFF_CONT);
if (ROFF_MAX == (t = roff_parse(*bufp, &pos)))
return(ROFFRULE_DENY == rr ? ROFF_IGN : ROFF_CONT);