version 1.300, 2015/10/30 19:04:16 |
version 1.301, 2016/01/08 17:48:09 |
|
|
/* $Id$ */ |
/* $Id$ */ |
/* |
/* |
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org> |
* Copyright (c) 2010-2016 Ingo Schwarze <schwarze@openbsd.org> |
* Copyright (c) 2010 Joerg Sonnenberger <joerg@netbsd.org> |
* Copyright (c) 2010 Joerg Sonnenberger <joerg@netbsd.org> |
* |
* |
* Permission to use, copy, modify, and distribute this software for any |
* Permission to use, copy, modify, and distribute this software for any |
Line 1278 post_bl_head(POST_ARGS) |
|
Line 1278 post_bl_head(POST_ARGS) |
|
|
|
argv = nbl->args->argv + j; |
argv = nbl->args->argv + j; |
i = argv->sz; |
i = argv->sz; |
argv->sz += nh->nchild; |
for (nch = nh->child; nch != NULL; nch = nch->next) |
|
argv->sz++; |
argv->value = mandoc_reallocarray(argv->value, |
argv->value = mandoc_reallocarray(argv->value, |
argv->sz, sizeof(char *)); |
argv->sz, sizeof(char *)); |
|
|
Line 1291 post_bl_head(POST_ARGS) |
|
Line 1292 post_bl_head(POST_ARGS) |
|
nnext = nch->next; |
nnext = nch->next; |
roff_node_delete(NULL, nch); |
roff_node_delete(NULL, nch); |
} |
} |
nh->nchild = 0; |
|
nh->child = NULL; |
nh->child = NULL; |
} |
} |
|
|
Line 1352 post_bl(POST_ARGS) |
|
Line 1352 post_bl(POST_ARGS) |
|
*/ |
*/ |
|
|
assert(nchild->prev == NULL); |
assert(nchild->prev == NULL); |
if (--nbody->nchild == 0) { |
nbody->child = nnext; |
nbody->child = NULL; |
if (nnext == NULL) |
nbody->last = NULL; |
nbody->last = NULL; |
assert(nnext == NULL); |
else |
} else { |
|
nbody->child = nnext; |
|
nnext->prev = NULL; |
nnext->prev = NULL; |
} |
|
|
|
/* |
/* |
* Relink this child. |
* Relink this child. |
Line 1370 post_bl(POST_ARGS) |
|
Line 1367 post_bl(POST_ARGS) |
|
nchild->next = nblock; |
nchild->next = nblock; |
|
|
nblock->prev = nchild; |
nblock->prev = nchild; |
nparent->nchild++; |
|
if (nprev == NULL) |
if (nprev == NULL) |
nparent->child = nchild; |
nparent->child = nchild; |
else |
else |
Line 1688 post_sh_see_also(POST_ARGS) |
|
Line 1684 post_sh_see_also(POST_ARGS) |
|
n = mdoc->last->child; |
n = mdoc->last->child; |
lastname = lastsec = lastpunct = NULL; |
lastname = lastsec = lastpunct = NULL; |
while (n != NULL) { |
while (n != NULL) { |
if (n->tok != MDOC_Xr || n->nchild < 2) |
if (n->tok != MDOC_Xr || |
|
n->child == NULL || |
|
n->child->next == NULL) |
break; |
break; |
|
|
/* Process one .Xr node. */ |
/* Process one .Xr node. */ |
Line 1744 child_an(const struct roff_node *n) |
|
Line 1742 child_an(const struct roff_node *n) |
|
{ |
{ |
|
|
for (n = n->child; n != NULL; n = n->next) |
for (n = n->child; n != NULL; n = n->next) |
if ((n->tok == MDOC_An && n->nchild) || child_an(n)) |
if ((n->tok == MDOC_An && n->child != NULL) || child_an(n)) |
return 1; |
return 1; |
return 0; |
return 0; |
} |
} |
Line 1931 post_par(POST_ARGS) |
|
Line 1929 post_par(POST_ARGS) |
|
post_prevpar(mdoc); |
post_prevpar(mdoc); |
|
|
if (np->tok == MDOC_sp) { |
if (np->tok == MDOC_sp) { |
if (np->nchild > 1) |
if (np->child != NULL && np->child->next != NULL) |
mandoc_vmsg(MANDOCERR_ARG_EXCESS, mdoc->parse, |
mandoc_vmsg(MANDOCERR_ARG_EXCESS, mdoc->parse, |
np->child->next->line, np->child->next->pos, |
np->child->next->line, np->child->next->pos, |
"sp ... %s", np->child->next->string); |
"sp ... %s", np->child->next->string); |