diff options
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | mdoc.7 | 10 | ||||
-rw-r--r-- | mdoc_term.c | 16 | ||||
-rw-r--r-- | regress/mdoc/Bl/breakingTa.in | 2 |
4 files changed, 19 insertions, 13 deletions
@@ -1,4 +1,4 @@ -$Id: NEWS,v 1.19 2017/02/12 14:19:01 schwarze Exp $ +$Id: NEWS,v 1.20 2017/02/16 14:38:12 schwarze Exp $ This file lists the most important changes in the mdocml.bsd.lv distribution. @@ -65,6 +65,8 @@ Changes in version 1.14.1, released on February XXX, 2017 for empty matrices and empty square roots. * mdoc(7): Fix an assertion failure for a .Bd without a type that breaks another block. + * mdoc(7): Fix an assertion failure that happened for some .Bl -column + lists containing a column width of "-4n", "-3n", or "-2n". * mdoc(7): Fix an assertion failure caused by .Bl -column without .It but containing eqn(7) or tbl(7) code. * roff(7): Fix an assertion failure caused by \z\[u00FF] with -Tps/-Tpdf. @@ -1,4 +1,4 @@ -.\" $Id: mdoc.7,v 1.261 2017/02/05 22:30:29 schwarze Exp $ +.\" $Id: mdoc.7,v 1.262 2017/02/16 14:38:12 schwarze Exp $ .\" .\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> .\" Copyright (c) 2010, 2011, 2013-2017 Ingo Schwarze <schwarze@openbsd.org> @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: February 5 2017 $ +.Dd $Mdocdate: February 16 2017 $ .Dt MDOC 7 .Os .Sh NAME @@ -974,10 +974,8 @@ argument. A columnated list. The .Fl width -argument has no effect; instead, each argument specifies the width -of one column, using either the scaling width syntax described in -.Xr roff 7 -or the string length of the argument. +argument has no effect; instead, the string length of each argument +specifies the width of one column. If the first line of the body of a .Fl column list is not an diff --git a/mdoc_term.c b/mdoc_term.c index 398fc3f5..bc125f29 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.344 2017/02/16 03:00:23 schwarze Exp $ */ +/* $Id: mdoc_term.c,v 1.345 2017/02/16 14:38:12 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2012-2017 Ingo Schwarze <schwarze@openbsd.org> @@ -606,6 +606,7 @@ termp_ll_pre(DECL_ARGS) static int termp_it_pre(DECL_ARGS) { + struct roffsu su; char buf[24]; const struct roff_node *bl, *nn; size_t ncols, dcol; @@ -683,9 +684,12 @@ termp_it_pre(DECL_ARGS) for (i = 0, nn = n->prev; nn->prev && i < (int)ncols; - nn = nn->prev, i++) - offset += dcol + a2width(p, - bl->norm->Bl.cols[i]); + nn = nn->prev, i++) { + SCALE_HS_INIT(&su, + term_strlen(p, bl->norm->Bl.cols[i])); + su.scale /= term_strlen(p, "0"); + offset += term_hspan(p, &su) / 24 + dcol; + } /* * When exceeding the declared number of columns, leave @@ -700,7 +704,9 @@ termp_it_pre(DECL_ARGS) * Use the declared column widths, extended as explained * in the preceding paragraph. */ - width = a2width(p, bl->norm->Bl.cols[i]) + dcol; + SCALE_HS_INIT(&su, term_strlen(p, bl->norm->Bl.cols[i])); + su.scale /= term_strlen(p, "0"); + width = term_hspan(p, &su) / 24 + dcol; break; default: if (NULL == bl->norm->Bl.width) diff --git a/regress/mdoc/Bl/breakingTa.in b/regress/mdoc/Bl/breakingTa.in index ca8e5769..80192b6c 100644 --- a/regress/mdoc/Bl/breakingTa.in +++ b/regress/mdoc/Bl/breakingTa.in @@ -7,7 +7,7 @@ .Sh DESCRIPTION .\" Crashed before mdoc_macro.c OpenBSD rev. 1.172 initial text -.Bl -column 6n 6n +.Bl -column 123456 123456 .It it Aq aq Ta ta Bo bo bc .Bc Pq pq .El |