From: Michael Tremer Date: Tue, 18 Oct 2022 18:25:36 +0000 (+0000) Subject: compress: Add entry to filelist before we modify it X-Git-Tag: 0.9.28~249 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5503d5345dcfafab217dd9f5b7e4ccbeb5e3ab4;p=pakfire.git compress: Add entry to filelist before we modify it Signed-off-by: Michael Tremer --- 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