-/* $Id: man_macro.c,v 1.48 2010/06/26 16:07:08 kristaps Exp $ */
+/* $Id: man_macro.c,v 1.55 2011/01/12 16:55:22 kristaps Exp $ */
/*
- * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv>
+ * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
{ in_line_eoln, 0 }, /* IR */
{ in_line_eoln, 0 }, /* RI */
{ in_line_eoln, MAN_NSCOPED }, /* na */
- { in_line_eoln, 0 }, /* i */
{ in_line_eoln, MAN_NSCOPED }, /* sp */
{ in_line_eoln, 0 }, /* nf */
{ in_line_eoln, 0 }, /* fi */
- { in_line_eoln, 0 }, /* r */
{ blk_close, 0 }, /* RE */
{ blk_exp, MAN_EXPLICIT }, /* RS */
{ in_line_eoln, 0 }, /* DT */
{ in_line_eoln, 0 }, /* UC */
{ in_line_eoln, 0 }, /* PD */
- { in_line_eoln, MAN_NSCOPED }, /* Sp */
- { in_line_eoln, 0 }, /* Vb */
- { in_line_eoln, 0 }, /* Ve */
{ in_line_eoln, 0 }, /* AT */
+ { in_line_eoln, 0 }, /* in */
+ { in_line_eoln, 0 }, /* ft */
};
const struct man_macro * const man_macros = __man_macros;
* will be used if an explicit block scope is being closed out.
*/
int
-man_unscope(struct man *m, const struct man_node *n,
+man_unscope(struct man *m, const struct man_node *to,
enum mandocerr er)
{
+ struct man_node *n;
- assert(n);
+ assert(to);
/* LINTED */
- while (m->last != n) {
+ while (m->last != to) {
+ /*
+ * Save the parent here, because we may delete the
+ * m->last node in the post-validation phase and reset
+ * it to m->last->parent, causing a step in the closing
+ * out to be lost.
+ */
+ n = m->last->parent;
if ( ! rew_warn(m, m->last, er))
return(0);
if ( ! man_valid_post(m))
return(0);
- if ( ! man_action_post(m))
- return(0);
- m->last = m->last->parent;
+ m->last = n;
assert(m->last);
}
return(0);
if ( ! man_valid_post(m))
return(0);
- if ( ! man_action_post(m))
- return(0);
m->next = MAN_ROOT == m->last->type ?
MAN_NEXT_CHILD : MAN_NEXT_SIBLING;
break;
if ( ! man_valid_post(m))
return(0);
- if ( ! man_action_post(m))
- return(0);
}
assert(m->last);
if (m->last->type != MAN_ROOT && ! man_valid_post(m))
return(0);
- if (m->last->type != MAN_ROOT && ! man_action_post(m))
- return(0);
m->next = MAN_ROOT == m->last->type ?
MAN_NEXT_CHILD : MAN_NEXT_SIBLING;