=================================================================== RCS file: /cvs/mandoc/mdoc_argv.c,v retrieving revision 1.49 retrieving revision 1.51 diff -u -p -r1.49 -r1.51 --- mandoc/mdoc_argv.c 2010/05/17 22:11:42 1.49 +++ mandoc/mdoc_argv.c 2010/05/31 10:28:04 1.51 @@ -1,4 +1,4 @@ -/* $Id: mdoc_argv.c,v 1.49 2010/05/17 22:11:42 kristaps Exp $ */ +/* $Id: mdoc_argv.c,v 1.51 2010/05/31 10:28:04 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -210,6 +210,7 @@ static int mdoc_argflags[MDOC_MAX] = { 0, /* br */ 0, /* sp */ 0, /* %U */ + 0, /* Ta */ }; @@ -339,7 +340,7 @@ enum margserr mdoc_args(struct mdoc *m, int line, int *pos, char *buf, enum mdoct tok, char **v) { - int fl, c, i; + int fl; struct mdoc_node *n; fl = mdoc_argflags[tok]; @@ -347,26 +348,20 @@ mdoc_args(struct mdoc *m, int line, int *pos, if (MDOC_It != tok) return(args(m, line, pos, buf, fl, v)); - /* - * The `It' macro is a special case, as it acquires parameters from its - * parent `Bl' context, specifically, we're concerned with -column. + /* + * We know that we're in an `It', so it's reasonable to expect + * us to be sitting in a `Bl'. Someday this may not be the case + * (if we allow random `It's sitting out there), so provide a + * safe fall-back into the default behaviour. */ for (n = m->last; n; n = n->parent) - if (MDOC_BLOCK == n->type && MDOC_Bl == n->tok) + if (MDOC_Bl == n->tok) break; - assert(n); - c = (int)(n->args ? n->args->argc : 0); - assert(c > 0); - - /* LINTED */ - for (i = 0; i < c; i++) { - if (MDOC_Column != n->args->argv[i].arg) - continue; + if (n && LIST_column == n->data.list) { fl |= ARGS_TABSEP; fl &= ~ARGS_DELIM; - break; } return(args(m, line, pos, buf, fl, v)); @@ -468,7 +463,7 @@ args(struct mdoc *m, int line, int *pos, break; if (pp > *v && ' ' != *(pp - 1)) continue; - if (' ' == *(pp + 2) || 0 == *(pp + 2)) + if (' ' == *(pp + 2) || '\0' == *(pp + 2)) break; }