aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_argv.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-05-30 23:59:59 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-05-30 23:59:59 +0000
commit22b6eccf981f601d06f05d4e5bdebc8149b0690a (patch)
treeb5b57725e7dd5f2a46162a498ff661d619e905f8 /mdoc_argv.c
parent03f38e16e88471fcfd6d09c9d3cd7869785181ad (diff)
downloadmandoc-22b6eccf981f601d06f05d4e5bdebc8149b0690a.tar.gz
mandoc-22b6eccf981f601d06f05d4e5bdebc8149b0690a.tar.zst
mandoc-22b6eccf981f601d06f05d4e5bdebc8149b0690a.zip
Have mdoc_args() use enum mdoc_list instead of scanning.
Diffstat (limited to 'mdoc_argv.c')
-rw-r--r--mdoc_argv.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/mdoc_argv.c b/mdoc_argv.c
index c7ca2e64..ceba9873 100644
--- a/mdoc_argv.c
+++ b/mdoc_argv.c
@@ -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.50 2010/05/30 23:59:59 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -339,7 +339,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 +347,13 @@ 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.
- */
-
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));