summaryrefslogtreecommitdiffstats
path: root/mdoc.c
diff options
context:
space:
mode:
Diffstat (limited to 'mdoc.c')
-rw-r--r--mdoc.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/mdoc.c b/mdoc.c
index b09dfa30..d4d5f433 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -459,7 +459,10 @@ mdoc_tail_alloc(struct mdoc *m, int line, int pos, int tok)
p = node_alloc(m, line, pos, tok, MDOC_TAIL);
if (NULL == p)
return(0);
- return(node_append(m, p));
+ if ( ! node_append(m, p))
+ return(0);
+ m->next = MDOC_NEXT_CHILD;
+ return(1);
}
@@ -474,7 +477,10 @@ mdoc_head_alloc(struct mdoc *m, int line, int pos, int tok)
p = node_alloc(m, line, pos, tok, MDOC_HEAD);
if (NULL == p)
return(0);
- return(node_append(m, p));
+ if ( ! node_append(m, p))
+ return(0);
+ m->next = MDOC_NEXT_CHILD;
+ return(1);
}
@@ -486,7 +492,10 @@ mdoc_body_alloc(struct mdoc *m, int line, int pos, int tok)
p = node_alloc(m, line, pos, tok, MDOC_BODY);
if (NULL == p)
return(0);
- return(node_append(m, p));
+ if ( ! node_append(m, p))
+ return(0);
+ m->next = MDOC_NEXT_CHILD;
+ return(1);
}
@@ -502,7 +511,10 @@ mdoc_block_alloc(struct mdoc *m, int line, int pos,
p->args = args;
if (p->args)
(args->refcnt)++;
- return(node_append(m, p));
+ if ( ! node_append(m, p))
+ return(0);
+ m->next = MDOC_NEXT_CHILD;
+ return(1);
}
@@ -518,7 +530,10 @@ mdoc_elem_alloc(struct mdoc *m, int line, int pos,
p->args = args;
if (p->args)
(args->refcnt)++;
- return(node_append(m, p));
+ if ( ! node_append(m, p))
+ return(0);
+ m->next = MDOC_NEXT_CHILD;
+ return(1);
}