compress: make decompressor_new() accept NONE

This commit is contained in:
Yu Watanabe
2026-08-24 03:30:52 +09:00
parent 4e2cb2bdf1
commit 87693c7073
+6 -1
View File
@@ -1715,6 +1715,8 @@ static int decompressor_new(Decompressor **ret, Compression type) {
c->type = _COMPRESSION_INVALID;
switch (type) {
case COMPRESSION_NONE:
break;
#if HAVE_XZ
case COMPRESSION_XZ:
@@ -1758,7 +1760,7 @@ static int decompressor_new(Decompressor **ret, Compression type) {
#endif
default:
return -EOPNOTSUPP;
assert_not_reached();
}
c->type = type;
@@ -1780,6 +1782,9 @@ int decompress_stream(
assert(fdf >= 0);
assert(fdt >= 0);
if (type == COMPRESSION_NONE)
return -EOPNOTSUPP;
r = dlopen_compress(type, LOG_DEBUG);
if (r < 0)
return r;