From e5503d5345dcfafab217dd9f5b7e4ccbeb5e3ab4 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 18 Oct 2022 18:25:36 +0000 Subject: [PATCH] compress: Add entry to filelist before we modify it Signed-off-by: Michael Tremer --- src/libpakfire/compress.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/libpakfire/compress.c b/src/libpakfire/compress.c index 1c7c38a3b..9db8c0b52 100644 --- a/src/libpakfire/compress.c +++ b/src/libpakfire/compress.c @@ -682,6 +682,18 @@ static int __pakfire_extract(struct pakfire* pakfire, struct archive* a, // Fetch path const char* path = archive_entry_pathname(entry); + // Add entry to filelist (if requested) + if (data->filelist) { + r = pakfire_file_create_from_archive_entry(&file, pakfire, entry); + if (r) + goto ERROR; + + // Append the file to the list + r = pakfire_filelist_append(data->filelist, file); + if (r) + goto ERROR; + } + // Prepend the prefix if (*data->prefix) { // Compose file path @@ -708,18 +720,6 @@ static int __pakfire_extract(struct pakfire* pakfire, struct archive* a, } } - // Add entry to filelist (if requested) - if (data->filelist) { - r = pakfire_file_create_from_archive_entry(&file, pakfire, entry); - if (r) - goto ERROR; - - // Append the file to the list - r = pakfire_filelist_append(data->filelist, file); - if (r) - goto ERROR; - } - // Create file & extract payload if (data->writer) { // Fetch path again since we changed it -- 2.47.3