aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/man.c
diff options
context:
space:
mode:
Diffstat (limited to 'man.c')
-rw-r--r--man.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/man.c b/man.c
index 17e002b4..a901c82c 100644
--- a/man.c
+++ b/man.c
@@ -1,4 +1,4 @@
-/* $Id: man.c,v 1.112 2011/10/06 22:29:12 kristaps Exp $ */
+/* $Id: man.c,v 1.113 2011/11/07 01:24:40 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -543,13 +543,40 @@ man_pmacro(struct man *m, int ln, char *buf, int offs)
n = n->parent;
mandoc_vmsg(MANDOCERR_LINESCOPE, m->parse, n->line,
- n->pos, "%s", man_macronames[n->tok]);
+ n->pos, "%s breaks %s", man_macronames[tok],
+ man_macronames[n->tok]);
man_node_delete(m, n);
m->flags &= ~MAN_ELINE;
}
/*
+ * Remove prior BLINE macro that is being clobbered.
+ */
+ if ((m->flags & MAN_BLINE) &&
+ (MAN_BSCOPE & man_macros[tok].flags)) {
+ n = m->last;
+ assert(MAN_TEXT != n->type);
+
+ /* Remove element that didn't end BLINE, if any. */
+
+ if ( ! (MAN_BSCOPE & man_macros[n->tok].flags))
+ n = n->parent;
+
+ assert(MAN_HEAD == n->type);
+ n = n->parent;
+ assert(MAN_BLOCK == n->type);
+ assert(MAN_SCOPED & man_macros[n->tok].flags);
+
+ mandoc_vmsg(MANDOCERR_LINESCOPE, m->parse, n->line,
+ n->pos, "%s breaks %s", man_macronames[tok],
+ man_macronames[n->tok]);
+
+ man_node_delete(m, n);
+ m->flags &= ~MAN_BLINE;
+ }
+
+ /*
* Save the fact that we're in the next-line for a block. In
* this way, embedded roff instructions can "remember" state
* when they exit.