libarchive: auto-detect .Z files as well
authorThiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
Sun, 3 May 2015 16:40:12 +0000 (18:40 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 3 May 2015 16:40:12 +0000 (18:40 +0200)
Signed-off-by: Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
archival/libarchive/open_transformer.c

index ab6aa3afc5379b189f9fbd7ebb086c20150164ad..be536a3d7e715f41ef0e1aacd30842092844dc7e 100644 (file)
@@ -185,6 +185,13 @@ static transformer_state_t *setup_transformer_on_fd(int fd, int fail_if_not_comp
                USE_FOR_NOMMU(xstate->xformer_prog = "gunzip";)
                goto found_magic;
        }
+       if (ENABLE_FEATURE_SEAMLESS_Z
+        && magic.b16[0] == COMPRESS_MAGIC
+       ) {
+               xstate->xformer = unpack_Z_stream;
+               USE_FOR_NOMMU(xstate->xformer_prog = "uncompress";)
+               goto found_magic;
+       }
        if (ENABLE_FEATURE_SEAMLESS_BZ2
         && magic.b16[0] == BZIP2_MAGIC
        ) {