# HG changeset patch # User Pascal Bellard # Date 1389275987 0 # Node ID 9b20a58d72467daa6ea11a738a9699f0e01d3861 # Parent 59dc636584829c54162e5bb70ebabed48eb3debe busybox: zcat should not check .gz extention diff -r 59dc63658482 -r 9b20a58d7246 busybox/stuff/busybox-1.22-zmodules.u --- a/busybox/stuff/busybox-1.22-zmodules.u Wed Jan 08 11:08:16 2014 +0000 +++ b/busybox/stuff/busybox-1.22-zmodules.u Thu Jan 09 13:59:47 2014 +0000 @@ -1,5 +1,5 @@ Add LZMA_DEFAULT_MAGIC support ---- busybox-1.20/archival/libarchive/open_transformer.c.ORG +--- busybox-1.20/archival/libarchive/open_transformer.c +++ busybox-1.20/archival/libarchive/open_transformer.c @@ -132,6 +132,21 @@ /* .gz and .bz2 both have 2-byte signature, and their @@ -23,3 +23,32 @@ if (ENABLE_FEATURE_SEAMLESS_GZ && magic.b16[0] == GZIP_MAGIC ) { + +--- busybox-1.22.0/archival/libarchive/open_transformer.c ++++ busybox-1.22.0/archival/libarchive/open_transformer.c +@@ -205,15 +205,15 @@ + return fd; + + sfx = strrchr(fname, '.'); +- if (sfx) { +- sfx++; +- if (ENABLE_FEATURE_SEAMLESS_LZMA && strcmp(sfx, "lzma") == 0) +- /* .lzma has no header/signature, just trust it */ +- open_transformer_with_sig(fd, unpack_lzma_stream, "unlzma"); +- else +- if ((ENABLE_FEATURE_SEAMLESS_GZ && strcmp(sfx, "gz") == 0) +- || (ENABLE_FEATURE_SEAMLESS_BZ2 && strcmp(sfx, "bz2") == 0) +- || (ENABLE_FEATURE_SEAMLESS_XZ && strcmp(sfx, "xz") == 0) ++ if (sfx++ && ENABLE_FEATURE_SEAMLESS_LZMA && strcmp(sfx, "lzma") == 0) { ++ /* .lzma has no header/signature, just trust it */ ++ open_transformer_with_sig(fd, unpack_lzma_stream, "unlzma"); ++ } ++ else { ++ if ((ENABLE_FEATURE_SEAMLESS_GZ) ++ || (ENABLE_FEATURE_SEAMLESS_BZ2) ++ || (ENABLE_FEATURE_SEAMLESS_LZMA) ++ || (ENABLE_FEATURE_SEAMLESS_XZ) + ) { + setup_unzip_on_fd(fd, /*fail_if_not_detected:*/ 1); + } +