From 789580a2a2366243d622766fdadd094931ca6596 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Thu, 8 Jun 2017 12:54:58 +0000 Subject: 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 --- html.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'html.c') 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 * Copyright (c) 2011-2015, 2017 Ingo Schwarze @@ -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) -- cgit v1.2.3