summaryrefslogtreecommitdiffstats
path: root/macro.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-01-08 15:59:58 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-01-08 15:59:58 +0000
commit89154444b764aaaab42730cdbca579364a797bfa (patch)
treeb8dc8a8456da41e4b6ac4d2e8ecf1868437a6011 /macro.c
parenta3d3b16eec4639d37e9f2aec893405c2a65c965a (diff)
downloadmandoc-89154444b764aaaab42730cdbca579364a797bfa.tar.gz
*** empty log message ***
Diffstat (limited to 'macro.c')
-rw-r--r--macro.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/macro.c b/macro.c
index 53caf6fe..dfd921a0 100644
--- a/macro.c
+++ b/macro.c
@@ -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);
}