From 2afeac43e2a5c0d484100eedd192842d27944558 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Tue, 7 Jan 2020 01:12:26 +0100 Subject: 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 --- NEWS | 2 ++ URPM.xs | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 68c542f..8a3f311 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +- fix support for hdlist compressed with !gzip + Version 5.23.2 - 30 December 2019 - restore compatibility with rpm build w/o support for zstd diff --git a/URPM.xs b/URPM.xs index 83ab837..efdacbd 100644 --- a/URPM.xs +++ b/URPM.xs @@ -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); -- cgit v1.2.1