zlib: Allow zlib.gunzip features with zlib.unzip
Pull Request check-list
-
Does make -j8 test
(UNIX) orvcbuild test nosign
(Windows) pass with this change (including linting)? -
Is the commit message formatted according to CONTRIBUTING.md? -
If this change fixes a bug (or a performance problem), is a regression test (or a benchmark) included?
Affected core subsystem(s)
zlib
Description of change
Detect whether a gzip file is being passed to unzip*
by testing the first bytes for the gzip magic bytes, and setting the decompression mode to GUNZIP
or INFLATE
according to the result.
This enables gzip-only features like multi-member support to be used together with the unzip*
autodetection support and thereby makes gunzip*
and unzip*
return identical results for gzip input again.
This is more or less a follow-up change to #5120.