=================================================================== RCS file: /cvs/mandoc/man_html.c,v retrieving revision 1.93 retrieving revision 1.100 diff -u -p -r1.93 -r1.100 --- mandoc/man_html.c 2014/04/20 16:46:04 1.93 +++ mandoc/man_html.c 2014/09/27 09:13:39 1.100 @@ -1,4 +1,4 @@ -/* $Id: man_html.c,v 1.93 2014/04/20 16:46:04 schwarze Exp $ */ +/* $Id: man_html.c,v 1.100 2014/09/27 09:13:39 kristaps Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2013, 2014 Ingo Schwarze @@ -15,9 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include @@ -28,6 +26,7 @@ #include #include "mandoc.h" +#include "mandoc_aux.h" #include "out.h" #include "html.h" #include "man.h" @@ -300,22 +299,16 @@ a2width(const struct man_node *n, struct roffsu *su) static void man_root_pre(MAN_ARGS) { - struct htmlpair tag[3]; + struct htmlpair tag[2]; struct tag *t, *tt; - char b[BUFSIZ], title[BUFSIZ]; + char *title; - b[0] = 0; - if (man->vol) - (void)strlcat(b, man->vol, BUFSIZ); - assert(man->title); assert(man->msec); - snprintf(title, BUFSIZ - 1, "%s(%s)", man->title, man->msec); + mandoc_asprintf(&title, "%s(%s)", man->title, man->msec); - PAIR_SUMMARY_INIT(&tag[0], "Document Header"); - PAIR_CLASS_INIT(&tag[1], "head"); - PAIR_INIT(&tag[2], ATTR_WIDTH, "100%"); - t = print_otag(h, TAG_TABLE, 3, tag); + PAIR_CLASS_INIT(&tag[0], "head"); + t = print_otag(h, TAG_TABLE, 1, tag); PAIR_INIT(&tag[0], ATTR_WIDTH, "30%"); print_otag(h, TAG_COL, 1, tag); print_otag(h, TAG_COL, 1, tag); @@ -333,26 +326,25 @@ man_root_pre(MAN_ARGS) PAIR_CLASS_INIT(&tag[0], "head-vol"); PAIR_INIT(&tag[1], ATTR_ALIGN, "center"); print_otag(h, TAG_TD, 2, tag); - print_text(h, b); + if (NULL != man->vol) + print_text(h, man->vol); print_stagq(h, tt); PAIR_CLASS_INIT(&tag[0], "head-rtitle"); - PAIR_INIT(&tag[1], ATTR_ALIGN, "right"); - print_otag(h, TAG_TD, 2, tag); + print_otag(h, TAG_TD, 1, tag); print_text(h, title); print_tagq(h, t); + free(title); } static void man_root_post(MAN_ARGS) { - struct htmlpair tag[3]; + struct htmlpair tag[2]; struct tag *t, *tt; - PAIR_SUMMARY_INIT(&tag[0], "Document Footer"); - PAIR_CLASS_INIT(&tag[1], "foot"); - PAIR_INIT(&tag[2], ATTR_WIDTH, "100%"); - t = print_otag(h, TAG_TABLE, 3, tag); + PAIR_CLASS_INIT(&tag[0], "foot"); + t = print_otag(h, TAG_TABLE, 1, tag); PAIR_INIT(&tag[0], ATTR_WIDTH, "50%"); print_otag(h, TAG_COL, 1, tag); print_otag(h, TAG_COL, 1, tag); @@ -367,8 +359,7 @@ man_root_post(MAN_ARGS) print_stagq(h, tt); PAIR_CLASS_INIT(&tag[0], "foot-os"); - PAIR_INIT(&tag[1], ATTR_ALIGN, "right"); - print_otag(h, TAG_TD, 2, tag); + print_otag(h, TAG_TD, 1, tag); if (man->source) print_text(h, man->source); @@ -389,7 +380,7 @@ man_br_pre(MAN_ARGS) if ( ! a2roffsu(n->string, &su, SCALE_VS)) SCALE_VS_INIT(&su, atoi(n->string)); } else - su.scale = 0; + su.scale = 0.0; bufinit(h); bufcat_su(h, "height", &su);