diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-01-12 10:31:53 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-01-12 10:31:53 +0000 |
commit | 062881c5bc9c7803c1b4caaca0d73dfd937f3445 (patch) | |
tree | 4eef2bacce9049ce36b7779756435cbc274a4dc9 /mdoc.c | |
parent | 9a5b4bcb2e33907e5840f6a576a7cac39f080343 (diff) | |
download | mandoc-062881c5bc9c7803c1b4caaca0d73dfd937f3445.tar.gz |
*** empty log message ***
Diffstat (limited to 'mdoc.c')
-rw-r--r-- | mdoc.c | 37 |
1 files changed, 5 insertions, 32 deletions
@@ -283,7 +283,8 @@ mdoc_parseln(struct mdoc *mdoc, int line, char *buf) if ('.' != *buf) { if (SEC_PROLOGUE != mdoc->sec_lastn) { - mdoc_word_alloc(mdoc, line, 0, buf); + if ( ! mdoc_word_alloc(mdoc, line, 0, buf)) + return(0); mdoc->next = MDOC_NEXT_SIBLING; return(1); } @@ -392,37 +393,7 @@ mdoc_macro(struct mdoc *mdoc, int tok, static int mdoc_node_append(struct mdoc *mdoc, struct mdoc_node *p) { - const char *nn, *on, *nt, *ot, *act; - - switch (p->type) { - case (MDOC_TEXT): - nn = p->data.text.string; - nt = "text"; - break; - case (MDOC_BODY): - nn = mdoc_macronames[p->data.body.tok]; - nt = "body"; - break; - case (MDOC_ELEM): - nn = mdoc_macronames[p->data.elem.tok]; - nt = "elem"; - break; - case (MDOC_HEAD): - nn = mdoc_macronames[p->data.head.tok]; - nt = "head"; - break; - case (MDOC_TAIL): - nn = mdoc_macronames[p->data.tail.tok]; - nt = "tail"; - break; - case (MDOC_BLOCK): - nn = mdoc_macronames[p->data.block.tok]; - nt = "block"; - break; - default: - abort(); - /* NOTREACHED */ - } + const char *on, *ot, *act; assert(mdoc->last); assert(mdoc->first); @@ -708,6 +679,8 @@ argcpy(struct mdoc_arg *dst, const struct mdoc_arg *src) { int i; + dst->line = src->line; + dst->pos = src->pos; dst->arg = src->arg; if (0 == (dst->sz = src->sz)) return; |