From: Natanael Copa Date: Tue, 25 Jul 2017 18:44:50 +0000 (+0200) Subject: unzip: fix regression on big-endian machines X-Git-Tag: 1_28_0~288 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=46f3f16b587ce781ab43a7b17698e1e565b2acf7;p=oweals%2Fbusybox.git unzip: fix regression on big-endian machines This fixes a regression which was introduced with commit 2a0867a5 ("unzip: optional support for bzip2 and lzma") and causes unzip to exit with error when extracting archives: unzip: unsupported method 2048 Signed-off-by: Natanael Copa Signed-off-by: Denys Vlasenko --- diff --git a/archival/unzip.c b/archival/unzip.c index bb39d954e..8ed9ae7d5 100644 --- a/archival/unzip.c +++ b/archival/unzip.c @@ -114,6 +114,7 @@ typedef union { #define FIX_ENDIANNESS_ZIP(zip) \ do { if (BB_BIG_ENDIAN) { \ + (zip).fmt.method = SWAP_LE16((zip).fmt.method ); \ (zip).fmt.crc32 = SWAP_LE32((zip).fmt.crc32 ); \ (zip).fmt.cmpsize = SWAP_LE32((zip).fmt.cmpsize ); \ (zip).fmt.ucmpsize = SWAP_LE32((zip).fmt.ucmpsize ); \