diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-07-26 05:52:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-07-26 05:52:14 +0000 |
commit | 8a67143a2cc2f55f9c3013a8467a84a2dd0c1c14 (patch) | |
tree | c64b3cecf08395f4e1e48ce022a2c69478a8ec6a /zutils.cc | |
parent | Adding upstream version 1.11. (diff) | |
download | zutils-8a67143a2cc2f55f9c3013a8467a84a2dd0c1c14.tar.xz zutils-8a67143a2cc2f55f9c3013a8467a84a2dd0c1c14.zip |
Adding upstream version 1.12~pre2.upstream/1.12_pre2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | zutils.cc | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -255,11 +255,14 @@ int test_format( const int infd, uint8_t magic_data[], gzip_magic_size = 2, lzip_magic_size = 5, xz_magic_size = 5, - zstd_magic_size = 4 }; + zstd_magic_size = 4, + compress_magic_size = 2 }; const uint8_t bzip2_magic[bzip2_magic_size] = { 0x42, 0x5A, 0x68 }; // "BZh" const uint8_t gzip_magic[gzip_magic_size] = { 0x1F, 0x8B }; + const uint8_t compress_magic[compress_magic_size] = + { 0x1F, 0x9D }; const uint8_t lzip_magic[lzip_magic_size] = { 0x4C, 0x5A, 0x49, 0x50, 0x01 }; // "LZIP\001" const uint8_t xz_magic[xz_magic_size] = @@ -277,7 +280,8 @@ int test_format( const int infd, uint8_t magic_data[], magic_data[3] >= '1' && magic_data[3] <= '9' && std::memcmp( magic_data + 4, "1AY&SY", 6 ) == 0 ) return fmt_bz2; - if( std::memcmp( magic_data, gzip_magic, gzip_magic_size ) == 0 ) + if( std::memcmp( magic_data, gzip_magic, gzip_magic_size ) == 0 || + std::memcmp( magic_data, compress_magic, compress_magic_size ) == 0 ) return fmt_gz; if( std::memcmp( magic_data, zstd_magic, zstd_magic_size ) == 0 ) return fmt_zst; |