-/* $Id: mdoc_macro.c,v 1.197 2015/04/29 21:58:32 schwarze Exp $ */
+/* $Id: mdoc_macro.c,v 1.200 2015/05/01 16:58:33 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012-2015 Ingo Schwarze <schwarze@openbsd.org>
static void
rew_last(struct roff_man *mdoc, const struct roff_node *to)
{
- struct roff_node *n, *np;
+ struct roff_node *np;
if (to->flags & MDOC_VALID)
return;
- mdoc->next = ROFF_NEXT_SIBLING;
while (mdoc->last != to) {
/*
* Save the parent here, because we may delete the
*/
np = mdoc->last->parent;
mdoc_valid_post(mdoc);
- n = mdoc->last;
mdoc->last = np;
assert(mdoc->last);
- mdoc->last->last = n;
}
+ mdoc->next = ROFF_NEXT_SIBLING;
mdoc_valid_post(mdoc);
}
if (mdoc->next == ROFF_NEXT_SIBLING)
n = n->parent;
if (n->tok == MDOC_Nm)
- rew_last(mdoc, mdoc->last->parent);
+ rew_last(mdoc, n->parent);
}
if (buf[*pos] == '\0' &&