From 1b6424e34de2a96aaa28ac28d0b0d83c0b46bdf4 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Thu, 8 Jan 2009 15:59:58 +0000 Subject: *** empty log message *** --- macro.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'macro.c') diff --git a/macro.c b/macro.c index 7247b382..9c5fc9bc 100644 --- a/macro.c +++ b/macro.c @@ -1,4 +1,4 @@ -/* $Id: macro.c,v 1.28 2009/01/08 14:55:59 kristaps Exp $ */ +/* $Id: macro.c,v 1.29 2009/01/08 15:59:58 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -55,19 +55,20 @@ rewind_last(struct mdoc *mdoc, struct mdoc_node *to) { assert(to); - while (mdoc->last != to) { + if (mdoc->last == to) + return(1); + + do { + mdoc->last = mdoc->last->parent; + assert(mdoc->last); if ( ! mdoc_valid_post(mdoc)) return(0); if ( ! mdoc_action_post(mdoc)) return(0); - mdoc->last = mdoc->last->parent; - assert(mdoc->last); - } + } while (mdoc->last != to); mdoc->next = MDOC_NEXT_SIBLING; - if ( ! mdoc_valid_post(mdoc)) - return(0); - return(mdoc_action_post(mdoc)); + return(1); } -- cgit v1.2.3-56-ge451