summaryrefslogtreecommitdiffstats
path: root/mdoc_html.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-06-03 13:44:36 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-06-03 13:44:36 +0000
commit07dfb14a298c0d0ed7988ffc395a5402873c61b2 (patch)
tree26859b601b8f0fc89617847b6dbcaf89de68c07a /mdoc_html.c
parenta101b1f81e1c47960a700d0827125c765f47544f (diff)
downloadmandoc-07dfb14a298c0d0ed7988ffc395a5402873c61b2.tar.gz
Consolidated list processing to a single loop in mdoc_validate.c. This
relieves having to repeat running over the argument list in mdoc_action.c and mdoc_validate.c. Default to LIST_item for type-less lists (groff technically doesn't do this: it just ignores the `It' lines altogether). Make MANDOC_LISTTYPE be a recoverable error.
Diffstat (limited to 'mdoc_html.c')
-rw-r--r--mdoc_html.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/mdoc_html.c b/mdoc_html.c
index 686c408a..fde75843 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -832,7 +832,6 @@ mdoc_it_block_pre(MDOC_ARGS, enum mdoc_list type, int comp,
struct roffsu su;
nn = n->parent->parent;
- assert(nn->args);
/* XXX: see notes in mdoc_it_pre(). */
@@ -1014,7 +1013,8 @@ mdoc_it_pre(MDOC_ARGS)
/* Get width, offset, and compact arguments. */
- for (wp = -1, comp = i = 0; i < (int)bl->args->argc; i++)
+ wp = -1;
+ for (comp = i = 0; bl->args && i < (int)bl->args->argc; i++)
switch (bl->args->argv[i].arg) {
case (MDOC_Column):
wp = i; /* Save for later. */
@@ -1322,7 +1322,7 @@ mdoc_bd_pre(MDOC_ARGS)
SCALE_VS_INIT(&su, 0);
type = comp = 0;
- for (i = 0; i < (int)bl->args->argc; i++)
+ for (i = 0; bl->args && i < (int)bl->args->argc; i++)
switch (bl->args->argv[i].arg) {
case (MDOC_Offset):
a2offs(bl->args->argv[i].value[0], &su);
@@ -1997,8 +1997,7 @@ mdoc_bf_pre(MDOC_ARGS)
else if ( ! strcmp("Li", n->head->child->string))
PAIR_CLASS_INIT(&tag[0], "lit");
} else {
- assert(n->args);
- for (i = 0; i < (int)n->args->argc; i++)
+ for (i = 0; n->args && i < (int)n->args->argc; i++)
switch (n->args->argv[i].arg) {
case (MDOC_Symbolic):
PAIR_CLASS_INIT(&tag[0], "symb");