summaryrefslogtreecommitdiffstats
path: root/man_macro.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-03-29 10:10:35 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-03-29 10:10:35 +0000
commite34909a15faed90ad1d9efd5e6d44270ab386b5c (patch)
tree5bc2959eed1e9d8a08a9ec591c11ba2ac015c601 /man_macro.c
parent40d86894cf83a9f39b0d85e391c7c16574971889 (diff)
downloadmandoc-e34909a15faed90ad1d9efd5e6d44270ab386b5c.tar.gz
Final (?) fix to issue pointed out by Sascha Wildner: roff instructions clobbering prior scope rules and line modes.
Diffstat (limited to 'man_macro.c')
-rw-r--r--man_macro.c28
1 files changed, 9 insertions, 19 deletions
diff --git a/man_macro.c b/man_macro.c
index 3c85f44c..550d162f 100644
--- a/man_macro.c
+++ b/man_macro.c
@@ -314,28 +314,14 @@ blk_dotted(MACRO_PROT_ARGS)
if ( ! rew_scope(MAN_BLOCK, m, ntok))
return(0);
- /*
- * XXX: manually adjust our next-line status. roff macros are,
- * for the moment, ignored, so we don't want to close out bodies
- * and so on.
- */
-
- switch (m->last->type) {
- case (MAN_BODY):
- m->next = MAN_NEXT_CHILD;
- break;
- default:
- break;
- }
-
/*
* Restore flags set when we got here and also stipulate that we
* don't post-process the line when exiting the macro op
- * function in man_pmacro().
+ * function in man_pmacro(). See blk_exp().
*/
- m->flags = m->svflags;
- m->flags |= MAN_ILINE;
+ m->flags = m->svflags | MAN_ILINE;
+ m->next = m->svnext;
return(1);
}
@@ -395,10 +381,14 @@ blk_exp(MACRO_PROT_ARGS)
return(0);
} else {
/*
- * Save our state; we restore it when exiting from the
- * roff instruction block.
+ * Save our state and next-scope indicator; we restore
+ * it when exiting from the roff instruction block. See
+ * blk_dotted().
*/
m->svflags = m->flags;
+ m->svnext = m->next;
+
+ /* Make sure we drop any line modes. */
m->flags = 0;
}