diff options
author | Thierry Vignaud <thierry.vignaud@gmail.com> | 2020-01-07 01:12:26 +0100 |
---|---|---|
committer | Thierry Vignaud <thierry.vignaud@gmail.com> | 2020-01-07 01:14:08 +0100 |
commit | 2afeac43e2a5c0d484100eedd192842d27944558 (patch) | |
tree | 90808fedd8c8c4d48b90ef66678479548b8d1b08 /URPM.xs | |
parent | 20e3335f865d353ce13349eeb22033dc0b388048 (diff) | |
download | perl-URPM-2afeac43e2a5c0d484100eedd192842d27944558.tar perl-URPM-2afeac43e2a5c0d484100eedd192842d27944558.tar.gz perl-URPM-2afeac43e2a5c0d484100eedd192842d27944558.tar.bz2 perl-URPM-2afeac43e2a5c0d484100eedd192842d27944558.tar.xz perl-URPM-2afeac43e2a5c0d484100eedd192842d27944558.zip |
fix support for hdlist compressed with !gzip
we were always defaulting to gzip format, whatever is the decompressor
specified in the archive
bug introduced in commit 18723d2d47f9e069667753703c12ba5139661957
Diffstat (limited to 'URPM.xs')
-rw-r--r-- | URPM.xs | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -993,13 +993,13 @@ open_archive(char *filename, int *empty_archive) { } else { /* this is an archive, prepare for reading with uncompress defined inside */ rfd = Fopen(filename, "r.fdio"); - if (strcmp(buf.uncompress, "gzip")) + if (!strncmp(buf.uncompress, "gzip", 4)) rfd = Fdopen(rfd, "r.gzip"); - else if (strcmp(buf.uncompress, "bzip")) + else if (!strncmp(buf.uncompress, "bzip2", 4)) rfd = Fdopen(rfd, "r.bzip2"); - else if (strcmp(buf.uncompress, "xz") || strcmp(buf.uncompress, "lzma")) + else if (!strncmp(buf.uncompress, "xz", 2) || !strncmp(buf.uncompress, "lzma", 4)) rfd = Fdopen(rfd, "r.xz"); - else if (strcmp(buf.uncompress, "zstd")) + else if (!strncmp(buf.uncompress, "zstd", 4)) rfd = Fdopen(rfd, "r.zstd"); else { free(rfd); |