=================================================================== RCS file: /cvs/mandoc/html.c,v retrieving revision 1.52 retrieving revision 1.53 diff -u -p -r1.52 -r1.53 --- mandoc/html.c 2009/09/24 09:50:31 1.52 +++ mandoc/html.c 2009/10/03 15:08:09 1.53 @@ -1,4 +1,4 @@ -/* $Id: html.c,v 1.52 2009/09/24 09:50:31 kristaps Exp $ */ +/* $Id: html.c,v 1.53 2009/10/03 15:08:09 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -83,10 +83,10 @@ void * html_alloc(char *outopts) { struct html *h; - char *toks[3], *v; + char *toks[4], *v; toks[0] = "style"; - toks[1] = "base"; + toks[1] = "man"; toks[2] = NULL; if (NULL == (h = calloc(1, sizeof(struct html)))) @@ -100,13 +100,15 @@ html_alloc(char *outopts) return(NULL); } + h->base_man = "%N.%S.html"; + while (outopts && *outopts) switch (getsubopt(&outopts, toks, &v)) { case (0): h->style = v; break; case (1): - h->base = v; + h->base_man = v; break; default: break; @@ -137,8 +139,11 @@ html_free(void *p) free(tag); } + if (h->buf) + free(h->buf); if (h->symtab) chars_free(h->symtab); + free(h); } @@ -170,12 +175,6 @@ print_gen_head(struct html *h) tag[3].key = ATTR_MEDIA; tag[3].val = "all"; print_otag(h, TAG_LINK, 4, tag); - } - - if (h->base) { - tag[0].key = ATTR_HREF; - tag[1].val = h->base; - print_otag(h, TAG_BASE, 1, tag); } }