]> git.cameronkatri.com Git - mandoc.git/blobdiff - html.c
duplicate word, found by igor(1)
[mandoc.git] / html.c
diff --git a/html.c b/html.c
index 28f8cf98e04dcb46dce41e15335a2fd068383638..65f7eea408fd34620a2845afc5214a9ca24b04dd 100644 (file)
--- a/html.c
+++ b/html.c
@@ -1,4 +1,4 @@
-/*     $Id: html.c,v 1.218 2017/07/14 16:28:38 schwarze Exp $ */
+/*     $Id: html.c,v 1.220 2017/09/06 16:24:25 schwarze Exp $ */
 /*
  * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2011-2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
 /*
  * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2011-2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -250,6 +250,8 @@ html_make_id(const struct roff_node *n)
 
        buf = NULL;
        deroff(&buf, n);
 
        buf = NULL;
        deroff(&buf, n);
+       if (buf == NULL)
+               return NULL;
 
        /* http://www.w3.org/TR/html5/dom.html#the-id-attribute */
 
 
        /* http://www.w3.org/TR/html5/dom.html#the-id-attribute */
 
@@ -624,24 +626,28 @@ print_otag(struct html *h, enum htmltag tag, const char *fmt, ...)
                        su = va_arg(ap, struct roffsu *);
                        break;
                case 'w':
                        su = va_arg(ap, struct roffsu *);
                        break;
                case 'w':
-                       if ((arg2 = va_arg(ap, char *)) == NULL) {
-                               if (*fmt == '+')
-                                       fmt++;
-                               if (*fmt == '-')
-                                       fmt++;
-                               break;
+                       if ((arg2 = va_arg(ap, char *)) != NULL) {
+                               su = &mysu;
+                               a2width(arg2, su);
+                       }
+                       if (*fmt == '*') {
+                               if (su != NULL && su->unit == SCALE_EN &&
+                                   su->scale > 5.9 && su->scale < 6.1)
+                                       su = NULL;
+                               fmt++;
                        }
                        }
-                       su = &mysu;
-                       a2width(arg2, su);
                        if (*fmt == '+') {
                        if (*fmt == '+') {
-                               /* Increase to make even bold text fit. */
-                               su->scale *= 1.2;
-                               /* Add padding. */
-                               su->scale += 3.0;
+                               if (su != NULL) {
+                                       /* Make even bold text fit. */
+                                       su->scale *= 1.2;
+                                       /* Add padding. */
+                                       su->scale += 3.0;
+                               }
                                fmt++;
                        }
                        if (*fmt == '-') {
                                fmt++;
                        }
                        if (*fmt == '-') {
-                               su->scale *= -1.0;
+                               if (su != NULL)
+                                       su->scale *= -1.0;
                                fmt++;
                        }
                        break;
                                fmt++;
                        }
                        break;