aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs8
1 files changed, 4 insertions, 4 deletions
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);