=================================================================== RCS file: /cvs/mandoc/main.c,v retrieving revision 1.345 retrieving revision 1.347 diff -u -p -r1.345 -r1.347 --- mandoc/main.c 2020/03/13 15:32:28 1.345 +++ mandoc/main.c 2020/03/28 16:18:43 1.347 @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.345 2020/03/13 15:32:28 schwarze Exp $ */ +/* $Id: main.c,v 1.347 2020/03/28 16:18:43 schwarze Exp $ */ /* * Copyright (c) 2010-2012, 2014-2020 Ingo Schwarze * Copyright (c) 2008-2012 Kristaps Dzonsons @@ -609,6 +609,7 @@ main(int argc, char *argv[]) (void)fchdir(startdir); close(startdir); } + term_tag_finish(); if (outst.outdata != NULL) { switch (outst.outtype) { case OUTT_HTML: @@ -617,7 +618,6 @@ main(int argc, char *argv[]) case OUTT_UTF8: case OUTT_LOCALE: case OUTT_ASCII: - term_tag_finish(); ascii_free(outst.outdata); break; case OUTT_PDF: @@ -831,16 +831,14 @@ process_onefile(struct mparse *mp, struct manpage *res } else fd = STDIN_FILENO; - if (outst->outtype <= OUTT_UTF8) { - if (outst->use_pager) { - outst->use_pager = 0; - outst->tag_files = term_tag_init(conf->output.tag); - } - if (outst->had_output) { - if (outst->outdata == NULL) - outdata_alloc(outst, &conf->output); - terminal_sepline(outst->outdata); - } + if (outst->use_pager) { + outst->use_pager = 0; + outst->tag_files = term_tag_init(conf->output.tag); + } + if (outst->had_output && outst->outtype <= OUTT_UTF8) { + if (outst->outdata == NULL) + outdata_alloc(outst, &conf->output); + terminal_sepline(outst->outdata); } if (resp->form == FORM_SRC)