wok-6.x rev 15777

busybox: zcat should not check .gz extention
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Jan 09 13:59:47 2014 +0000 (2014-01-09)
parents 59dc63658482
children 0bc9efb792e7
files busybox/stuff/busybox-1.22-zmodules.u
line diff
     1.1 --- a/busybox/stuff/busybox-1.22-zmodules.u	Wed Jan 08 11:08:16 2014 +0000
     1.2 +++ b/busybox/stuff/busybox-1.22-zmodules.u	Thu Jan 09 13:59:47 2014 +0000
     1.3 @@ -1,5 +1,5 @@
     1.4  Add LZMA_DEFAULT_MAGIC support
     1.5 ---- busybox-1.20/archival/libarchive/open_transformer.c.ORG
     1.6 +--- busybox-1.20/archival/libarchive/open_transformer.c
     1.7  +++ busybox-1.20/archival/libarchive/open_transformer.c
     1.8  @@ -132,6 +132,21 @@
     1.9   	/* .gz and .bz2 both have 2-byte signature, and their
    1.10 @@ -23,3 +23,32 @@
    1.11   	if (ENABLE_FEATURE_SEAMLESS_GZ
    1.12   	 && magic.b16[0] == GZIP_MAGIC
    1.13   	) {
    1.14 +
    1.15 +--- busybox-1.22.0/archival/libarchive/open_transformer.c
    1.16 ++++ busybox-1.22.0/archival/libarchive/open_transformer.c
    1.17 +@@ -205,15 +205,15 @@
    1.18 + 		return fd;
    1.19 + 
    1.20 + 	sfx = strrchr(fname, '.');
    1.21 +-	if (sfx) {
    1.22 +-		sfx++;
    1.23 +-		if (ENABLE_FEATURE_SEAMLESS_LZMA && strcmp(sfx, "lzma") == 0)
    1.24 +-			/* .lzma has no header/signature, just trust it */
    1.25 +-			open_transformer_with_sig(fd, unpack_lzma_stream, "unlzma");
    1.26 +-		else
    1.27 +-		if ((ENABLE_FEATURE_SEAMLESS_GZ && strcmp(sfx, "gz") == 0)
    1.28 +-		 || (ENABLE_FEATURE_SEAMLESS_BZ2 && strcmp(sfx, "bz2") == 0)
    1.29 +-		 || (ENABLE_FEATURE_SEAMLESS_XZ && strcmp(sfx, "xz") == 0)
    1.30 ++	if (sfx++ && ENABLE_FEATURE_SEAMLESS_LZMA && strcmp(sfx, "lzma") == 0) {
    1.31 ++		/* .lzma has no header/signature, just trust it */
    1.32 ++		open_transformer_with_sig(fd, unpack_lzma_stream, "unlzma");
    1.33 ++	}
    1.34 ++	else {
    1.35 ++		if ((ENABLE_FEATURE_SEAMLESS_GZ)
    1.36 ++		 || (ENABLE_FEATURE_SEAMLESS_BZ2)
    1.37 ++		 || (ENABLE_FEATURE_SEAMLESS_LZMA)
    1.38 ++		 || (ENABLE_FEATURE_SEAMLESS_XZ)
    1.39 + 		) {
    1.40 + 			setup_unzip_on_fd(fd, /*fail_if_not_detected:*/ 1);
    1.41 + 		}
    1.42 +