gzip -d with zcat enabled but gunzip disabled was misbehaving

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2020-06-25 02:01:29 +02:00
parent b02f8ca909
commit 24c212b9ac

View File

@ -386,7 +386,7 @@ int gunzip_main(int argc UNUSED_PARAM, char **argv)
* Normally, "zcat" is just "gunzip -c". * Normally, "zcat" is just "gunzip -c".
* But if seamless magic is enabled, then we are much more clever. * But if seamless magic is enabled, then we are much more clever.
*/ */
if (ENABLE_ZCAT && (!ENABLE_GUNZIP || applet_name[1] == 'c')) if (ENABLE_ZCAT && applet_name[1] == 'c')
option_mask32 |= BBUNPK_OPT_STDOUT | BBUNPK_SEAMLESS_MAGIC; option_mask32 |= BBUNPK_OPT_STDOUT | BBUNPK_SEAMLESS_MAGIC;
return bbunpack(argv, unpack_gz_stream, make_new_name_gunzip, /*unused:*/ NULL); return bbunpack(argv, unpack_gz_stream, make_new_name_gunzip, /*unused:*/ NULL);