aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-06-08 12:54:58 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-06-08 12:54:58 +0000
commit789580a2a2366243d622766fdadd094931ca6596 (patch)
tree60a78614bcfb83b55ebd45464a5bc77e4c61c98c /html.c
parent76a6887f123b221e7a8851c1b0d0008119492613 (diff)
downloadmandoc-789580a2a2366243d622766fdadd094931ca6596.tar.gz
mandoc-789580a2a2366243d622766fdadd094931ca6596.tar.zst
mandoc-789580a2a2366243d622766fdadd094931ca6596.zip
make the internal a2roffsu() interface more powerful by returning
a pointer to the end of the parsed data, making it easier to parse subsequent bytes
Diffstat (limited to 'html.c')
-rw-r--r--html.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/html.c b/html.c
index fef0aa0d..4bb3ca56 100644
--- a/html.c
+++ b/html.c
@@ -1,4 +1,4 @@
-/* $Id: html.c,v 1.212 2017/05/14 12:27:28 schwarze Exp $ */
+/* $Id: html.c,v 1.213 2017/06/08 12:54:58 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -950,7 +950,10 @@ print_word(struct html *h, const char *cp)
static void
a2width(const char *p, struct roffsu *su)
{
- if (a2roffsu(p, su, SCALE_MAX) < 2) {
+ const char *end;
+
+ end = a2roffsu(p, su, SCALE_MAX);
+ if (end == NULL || *end != '\0') {
su->unit = SCALE_EN;
su->scale = html_strlen(p);
} else if (su->scale < 0.0)