diff options
author | 2014-12-23 13:48:15 +0000 | |
---|---|---|
committer | 2014-12-23 13:48:15 +0000 | |
commit | bf8e53c9869db7abf5443183f2efb7ec67b973bc (patch) | |
tree | 9f1734421b33e5966b0f60a524123942b4d83218 /usr.bin/mandoc/mdoc_html.c | |
parent | pf now supports source-hash and random with tables so we can allow it (diff) | |
download | wireguard-openbsd-bf8e53c9869db7abf5443183f2efb7ec67b973bc.tar.xz wireguard-openbsd-bf8e53c9869db7abf5443183f2efb7ec67b973bc.zip |
support negative horizontal widths in man(7);
minus twenty lines of code in spite of enhanced functionality
Diffstat (limited to 'usr.bin/mandoc/mdoc_html.c')
-rw-r--r-- | usr.bin/mandoc/mdoc_html.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/mandoc/mdoc_html.c b/usr.bin/mandoc/mdoc_html.c index 05b678b2d26..4647aa41443 100644 --- a/usr.bin/mandoc/mdoc_html.c +++ b/usr.bin/mandoc/mdoc_html.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mdoc_html.c,v 1.92 2014/12/23 09:31:17 schwarze Exp $ */ +/* $OpenBSD: mdoc_html.c,v 1.93 2014/12/23 13:48:15 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org> @@ -280,7 +280,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; } /* @@ -1564,9 +1565,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; |