CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected]        2025/09/24 15:27:21

Modified files:
        usr.bin/mandoc : main.c 

Log message:
Fix a bug where formatting two compressed manual pages in row failed to
decompress the second one.  The problem was calling mparse*() functions
in the wrong order mparse_open -> mparse_reset -> mparse_readfd instead
of in the correct order mparse_reset -> mparse_open -> mparse_readfd:
mparse_reset() clears the gzip flag, mparse_open() sets it if the new
file is gzipped, and read_whole_file() called from mparse_readfd()
enables decompression if the flag is set.
To make the code easier to follow, call all of mparse_alloc(),
mparse_reset(), and mparse_free() from main() rather than hiding
mparse_reset() two levels down in the parse() subroutine.

Bug found by Alejandro Colomar <[email protected]> on Debian Sid
and reported on the GNU roff mailing list.

Reply via email to