=================================================================== RCS file: /cvs/mandoc/man_term.c,v retrieving revision 1.210 retrieving revision 1.211 diff -u -p -r1.210 -r1.211 --- mandoc/man_term.c 2018/04/11 17:11:13 1.210 +++ mandoc/man_term.c 2018/06/10 15:12:35 1.211 @@ -1,4 +1,4 @@ -/* $Id: man_term.c,v 1.210 2018/04/11 17:11:13 schwarze Exp $ */ +/* $Id: man_term.c,v 1.211 2018/06/10 15:12:35 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2015, 2017, 2018 Ingo Schwarze @@ -1032,6 +1032,18 @@ print_man_foot(struct termp *p, const struct roff_meta term_word(p, title); term_flushln(p); + + /* + * Reset the terminal state for more output after the footer: + * Some output modes, in particular PostScript and PDF, print + * the header and the footer into a buffer such that it can be + * reused for multiple output pages, then go on to format the + * main text. + */ + + p->tcol->offset = 0; + p->flags = 0; + free(title); }