=================================================================== RCS file: /cvs/mandoc/man_html.c,v retrieving revision 1.122 retrieving revision 1.126 diff -u -p -r1.122 -r1.126 --- mandoc/man_html.c 2017/01/17 01:47:51 1.122 +++ mandoc/man_html.c 2017/01/19 13:35:02 1.126 @@ -1,4 +1,4 @@ -/* $Id: man_html.c,v 1.122 2017/01/17 01:47:51 schwarze Exp $ */ +/* $Id: man_html.c,v 1.126 2017/01/19 13:35:02 schwarze Exp $ */ /* * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons * Copyright (c) 2013, 2014, 2015, 2017 Ingo Schwarze @@ -148,38 +148,34 @@ html_man(void *arg, const struct roff_man *man) { struct mhtml mh; struct html *h; - struct tag *t, *tt; + struct tag *t; memset(&mh, 0, sizeof(mh)); h = (struct html *)arg; - if ( ! (HTML_FRAGMENT & h->oflags)) { + if ((h->oflags & HTML_FRAGMENT) == 0) { print_gen_decls(h); - t = print_otag(h, TAG_HTML, ""); - tt = print_otag(h, TAG_HEAD, ""); + print_otag(h, TAG_HTML, ""); + t = print_otag(h, TAG_HEAD, ""); print_man_head(&man->meta, man->first, &mh, h); - print_tagq(h, tt); + print_tagq(h, t); print_otag(h, TAG_BODY, ""); - print_otag(h, TAG_DIV, "c", "mandoc"); - } else - t = print_otag(h, TAG_DIV, "c", "mandoc"); + } print_man_nodelist(&man->meta, man->first, &mh, h); - print_tagq(h, t); - putchar('\n'); + print_tagq(h, NULL); } static void print_man_head(MAN_ARGS) { + char *cp; print_gen_head(h); - assert(man->title); - assert(man->msec); - bufinit(h); - bufcat_fmt(h, "%s(%s)", man->title, man->msec); + mandoc_asprintf(&cp, "%s(%s)", man->title, man->msec); print_otag(h, TAG_TITLE, ""); - print_text(h, h->buf); + print_text(h, cp); + free(cp); } static void @@ -217,8 +213,6 @@ print_man_node(MAN_ARGS) print_text(h, n->string); return; case ROFFT_EQN: - if (n->flags & NODE_LINE) - putchar('\n'); print_eqn(h, n->eqn); break; case ROFFT_TBL: