diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-06-12 12:38:01 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-06-12 12:38:01 +0000 |
commit | ff7b52fc598055387eeb90035e1d6418b43d3c27 (patch) | |
tree | f4e4aac93954ad8c23c1b825da4207d9a3e82cd7 /mdoc_term.c | |
parent | ba4734a53e665e8062edb5784cf988d13c6ee165 (diff) | |
download | mandoc-ff7b52fc598055387eeb90035e1d6418b43d3c27.tar.gz |
Cached `Bl -offset' into mdoc_bl. Removed erroneous "-offset defaults
to 6n if no value is specified" and added regression tests for `Bl'
testing against the empty -offset argument.
Diffstat (limited to 'mdoc_term.c')
-rw-r--r-- | mdoc_term.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/mdoc_term.c b/mdoc_term.c index d8bde3c3..ecf8ad34 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -643,7 +643,7 @@ termp_it_pre(DECL_ARGS) { const struct mdoc_node *bl, *nn; char buf[7]; - int i, keys[3], vals[3]; + int i, keys[2], vals[2]; size_t width, offset, ncols, dcol; enum mdoc_list type; @@ -657,12 +657,11 @@ termp_it_pre(DECL_ARGS) /* Get list width, offset, and list type from argument list. */ keys[0] = MDOC_Width; - keys[1] = MDOC_Offset; - keys[2] = MDOC_Column; + keys[1] = MDOC_Column; - vals[0] = vals[1] = vals[2] = -1; + vals[0] = vals[1] = -1; - arg_getattrs(keys, vals, 3, bl); + arg_getattrs(keys, vals, 2, bl); type = bl->data.Bl.type; @@ -674,8 +673,9 @@ termp_it_pre(DECL_ARGS) width = offset = 0; - if (vals[1] >= 0) - offset = a2offs(bl->args->argv[vals[1]].value[0]); + if (bl->data.Bl.offs) + offset = a2offs(bl->data.Bl.offs); + switch (type) { case (LIST_column): @@ -690,7 +690,7 @@ termp_it_pre(DECL_ARGS) * column. * - For more than 5 columns, add only one column. */ - ncols = bl->args->argv[vals[2]].sz; + ncols = bl->args->argv[vals[1]].sz; /* LINTED */ dcol = ncols < 5 ? 4 : ncols == 5 ? 3 : 1; @@ -703,7 +703,7 @@ termp_it_pre(DECL_ARGS) nn->prev && i < (int)ncols; nn = nn->prev, i++) offset += dcol + a2width - (&bl->args->argv[vals[2]], i); + (&bl->args->argv[vals[1]], i); /* @@ -719,7 +719,7 @@ termp_it_pre(DECL_ARGS) * Use the declared column widths, extended as explained * in the preceding paragraph. */ - width = a2width(&bl->args->argv[vals[2]], i) + dcol; + width = a2width(&bl->args->argv[vals[1]], i) + dcol; break; default: if (vals[0] < 0) |