=================================================================== RCS file: /cvs/mandoc/mdoc_man.c,v retrieving revision 1.118 retrieving revision 1.119 diff -u -p -r1.118 -r1.119 --- mandoc/mdoc_man.c 2017/06/06 15:01:04 1.118 +++ mandoc/mdoc_man.c 2017/06/08 12:54:58 1.119 @@ -1,4 +1,4 @@ -/* $Id: mdoc_man.c,v 1.118 2017/06/06 15:01:04 schwarze Exp $ */ +/* $Id: mdoc_man.c,v 1.119 2017/06/08 12:54:58 schwarze Exp $ */ /* * Copyright (c) 2011-2017 Ingo Schwarze * @@ -476,6 +476,7 @@ print_offs(const char *v, int keywords) { char buf[24]; struct roffsu su; + const char *end; int sz; print_line(".RS", MMAN_Bk_susp); @@ -487,8 +488,11 @@ print_offs(const char *v, int keywords) sz = 6; else if (keywords && !strcmp(v, "indent-two")) sz = 12; - else if (a2roffsu(v, &su, SCALE_EN) > 1) { - if (SCALE_EN == su.unit) + else { + end = a2roffsu(v, &su, SCALE_EN); + if (end == NULL || *end != '\0') + sz = man_strlen(v); + else if (SCALE_EN == su.unit) sz = su.scale; else { /* @@ -502,8 +506,7 @@ print_offs(const char *v, int keywords) outflags |= MMAN_nl; return; } - } else - sz = man_strlen(v); + } /* * We are inside an enclosing list. @@ -525,6 +528,7 @@ print_width(const struct mdoc_bl *bl, const struct rof { char buf[24]; struct roffsu su; + const char *end; int numeric, remain, sz, chsz; numeric = 1; @@ -533,15 +537,17 @@ print_width(const struct mdoc_bl *bl, const struct rof /* Convert the width into a number (of characters). */ if (bl->width == NULL) sz = (bl->type == LIST_hang) ? 6 : 0; - else if (a2roffsu(bl->width, &su, SCALE_MAX) > 1) { - if (SCALE_EN == su.unit) + else { + end = a2roffsu(bl->width, &su, SCALE_MAX); + if (end == NULL || *end != '\0') + sz = man_strlen(bl->width); + else if (SCALE_EN == su.unit) sz = su.scale; else { sz = 0; numeric = 0; } - } else - sz = man_strlen(bl->width); + } /* XXX Rough estimation, might have multiple parts. */ if (bl->type == LIST_enum)