=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/html.c,v retrieving revision 1.53 retrieving revision 1.54 diff -c -r1.53 -r1.54 *** src/usr.bin/mandoc/html.c 2014/12/02 10:07:17 1.53 --- src/usr.bin/mandoc/html.c 2014/12/20 00:19:54 1.54 *************** *** 1,4 **** ! /* $OpenBSD: html.c,v 1.53 2014/12/02 10:07:17 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze --- 1,4 ---- ! /* $OpenBSD: html.c,v 1.54 2014/12/20 00:19:54 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze *************** *** 119,125 **** }; static void bufncat(struct html *, const char *, size_t); ! static void print_ctag(struct html *, enum htmltag); static int print_escape(char); static int print_encode(struct html *, const char *, int); static void print_metaf(struct html *, enum mandoc_esc); --- 119,125 ---- }; static void bufncat(struct html *, const char *, size_t); ! static void print_ctag(struct html *, struct tag *); static int print_escape(char); static int print_encode(struct html *, const char *, int); static void print_metaf(struct html *, enum mandoc_esc); *************** *** 509,522 **** } static void ! print_ctag(struct html *h, enum htmltag tag) { ! printf("", htmltags[tag].name); ! if (HTML_CLRLINE & htmltags[tag].flags) { h->flags |= HTML_NOSPACE; putchar('\n'); } } void --- 509,534 ---- } static void ! print_ctag(struct html *h, struct tag *tag) { ! /* ! * Remember to close out and nullify the current ! * meta-font and table, if applicable. ! */ ! if (tag == h->metaf) ! h->metaf = NULL; ! if (tag == h->tblt) ! h->tblt = NULL; ! ! printf("", htmltags[tag->tag].name); ! if (HTML_CLRLINE & htmltags[tag->tag].flags) { h->flags |= HTML_NOSPACE; putchar('\n'); } + + h->tags.head = tag->next; + free(tag); } void *************** *** 578,594 **** struct tag *tag; while ((tag = h->tags.head) != NULL) { ! /* ! * Remember to close out and nullify the current ! * meta-font and table, if applicable. ! */ ! if (tag == h->metaf) ! h->metaf = NULL; ! if (tag == h->tblt) ! h->tblt = NULL; ! print_ctag(h, tag->tag); ! h->tags.head = tag->next; ! free(tag); if (until && tag == until) return; } --- 590,596 ---- struct tag *tag; while ((tag = h->tags.head) != NULL) { ! print_ctag(h, tag); if (until && tag == until) return; } *************** *** 602,618 **** while ((tag = h->tags.head) != NULL) { if (suntil && tag == suntil) return; ! /* ! * Remember to close out and nullify the current ! * meta-font and table, if applicable. ! */ ! if (tag == h->metaf) ! h->metaf = NULL; ! if (tag == h->tblt) ! h->tblt = NULL; ! print_ctag(h, tag->tag); ! h->tags.head = tag->next; ! free(tag); } } --- 604,610 ---- while ((tag = h->tags.head) != NULL) { if (suntil && tag == suntil) return; ! print_ctag(h, tag); } }