diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-06-09 20:00:38 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-06-09 20:00:38 +0000 |
commit | b33e04fa7bbe5f17c54a8a302bf93d8a56784800 (patch) | |
tree | cc3cee916735cd4add0ced0de0ca84c6a1255495 /roff.c | |
parent | c92be367f7c707418fe2a4beb17688dffa614781 (diff) | |
download | mandoc-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.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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); |