From 6fcb5ea18d95e1cc79dd37b4e2860f4e8c898346 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Tue, 17 May 2011 11:38:18 +0000 Subject: [PATCH] Clean-up fallout: differentiate ID's and HREF's (where to put the `#'). Make buffmt functions internally bufinit(), too. --- html.c | 7 +++---- mdoc_html.c | 3 ++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/html.c b/html.c index 5203abdb..a50d2eb0 100644 --- a/html.c +++ b/html.c @@ -1,4 +1,4 @@ -/* $Id: html.c,v 1.142 2011/05/17 11:34:31 kristaps Exp $ */ +/* $Id: html.c,v 1.143 2011/05/17 11:38:18 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2011 Ingo Schwarze @@ -656,6 +656,7 @@ buffmt_includes(struct html *h, const char *name) pp = h->base_includes; + bufinit(h); while (NULL != (p = strchr(pp, '%'))) { bufncat(h, pp, (size_t)(p - pp)); switch (*(p + 1)) { @@ -680,7 +681,7 @@ buffmt_man(struct html *h, pp = h->base_man; - /* LINTED */ + bufinit(h); while (NULL != (p = strchr(pp, '%'))) { bufncat(h, pp, (size_t)(p - pp)); switch (*(p + 1)) { @@ -718,8 +719,6 @@ bufcat_id(struct html *h, const char *src) /* Cf. . */ - if (0 == h->buflen) - bufcat(h, "#x"); while ('\0' != *src) bufcat_fmt(h, "%.2x", *src++); } diff --git a/mdoc_html.c b/mdoc_html.c index 1e766b04..57ebc348 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.168 2011/05/17 11:34:31 kristaps Exp $ */ +/* $Id: mdoc_html.c,v 1.169 2011/05/17 11:38:18 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * @@ -1171,6 +1171,7 @@ mdoc_sx_pre(MDOC_ARGS) struct htmlpair tag[2]; bufinit(h); + bufcat(h, "#x"); for (n = n->child; n; n = n->next) { bufcat_id(h, n->string); if (n->next) -- 2.47.1