Bug 14626

Summary: gunzip -cf fails on uncompressed input
Product: Busybox Reporter: Thomas Christensen II <tchristensen>
Component: OtherAssignee: unassigned
Status: NEW ---    
Severity: normal CC: busybox-cvs
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:

Description Thomas Christensen II 2022-03-01 17:53:21 UTC
Trying to decompress uncompressed output with Busybox gunzip will fail even with
the -cf flag passed. 

Steps to Reproduce
------------------

    echo "uncompressed content" >> file
    gunzip -cf file

Actual Results
--------------

    gunzip: invalid magic

Expected Results
----------------

    uncompressed content

This expected behavior is given by the man page for GNU gunzip:

> -f --force: If the input data is not in a format recognized by gzip, and
> if the option --stdout is also given, copy the input data without change to
> the standard output: let zcat behave as cat.

Build date & Hardware
---------------------

Unknown: I first encountered this in the biocontainers Docker images, and created the above example with the busybox:1.34.1-uclibc Docker image.