summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2017-06-08 12:54:41 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2017-06-08 12:54:41 +0000
commitcab67ace0d6b1ee2288f2cb6c0534158963a9584 (patch)
tree2395ece0acf7f7e400b90675ad48168849e2bd2e /usr.bin/mandoc/html.c
parentb66628aa0c9008c3a011b8eaf0b39fcb9838dbbd (diff)
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 'usr.bin/mandoc/html.c')
-rw-r--r--usr.bin/mandoc/html.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/mandoc/html.c b/usr.bin/mandoc/html.c
index 4c6a3d9416d..f25c21da748 100644
--- a/usr.bin/mandoc/html.c
+++ b/usr.bin/mandoc/html.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: html.c,v 1.82 2017/05/14 12:26:59 schwarze Exp $ */
+/* $OpenBSD: html.c,v 1.83 2017/06/08 12:54:40 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -948,7 +948,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)