summaryrefslogtreecommitdiffstatshomepage
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
commitce0ad98d5799eeab84796f4d6a7ed2450a21010b (patch)
tree2084a5121b42f0afe6f85c813f72a7b9b1d85b87 /mdoc_html.c
parent68b68248d4c207e5fb883e570a5a285fc0385636 (diff)
downloadmandoc-ce0ad98d5799eeab84796f4d6a7ed2450a21010b.tar.gz
mandoc-ce0ad98d5799eeab84796f4d6a7ed2450a21010b.tar.zst
mandoc-ce0ad98d5799eeab84796f4d6a7ed2450a21010b.zip
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.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/mdoc_html.c b/mdoc_html.c
index 894d605e..76a7fe8c 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_html.c,v 1.71 2010/05/31 10:28:04 kristaps Exp $ */
+/* $Id: mdoc_html.c,v 1.72 2010/06/03 13:44:36 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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");