From 4ad53635f5202474c55af90f70bba0ade18962cb Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Tue, 23 Dec 2014 13:48:57 +0000 Subject: support negative horizontal widths in man(7); minus twenty lines of code in spite of enhanced functionality --- mdoc_html.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'mdoc_html.c') diff --git a/mdoc_html.c b/mdoc_html.c index 402ee1ad..885565e3 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -282,7 +282,8 @@ a2width(const char *p, struct roffsu *su) if (a2roffsu(p, su, SCALE_MAX) < 2) { su->unit = SCALE_EN; su->scale = html_strlen(p); - } + } else if (su->scale < 0.0) + su->scale = 0.0; } /* @@ -1566,9 +1567,12 @@ mdoc_sp_pre(MDOC_ARGS) SCALE_VS_INIT(&su, 1); if (MDOC_sp == n->tok) { - if (NULL != (n = n->child)) + if (NULL != (n = n->child)) { if ( ! a2roffsu(n->string, &su, SCALE_VS)) su.scale = 1.0; + else if (su.scale < 0.0) + su.scale = 0.0; + } } else su.scale = 0.0; -- cgit