commit d982809f6a0e8486231d6b69ed990c54ecdd65d5
parent be0082cc1a7c2251f2aa6fd5b868b8bd6716da51
Author: wwp <wwp@free.fr>
Date: Mon, 11 Jun 2018 19:12:20 +0200
Reduce scope of few variables.
Diffstat:
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/plugins/archive/libarchive_archive.c b/src/plugins/archive/libarchive_archive.c
@@ -441,13 +441,6 @@ const gchar* archive_extract(const char* archive_name, int flags) {
const gchar* archive_create(const char* archive_name, GSList* files,
COMPRESS_METHOD method, ARCHIVE_FORMAT format) {
struct archive* arch;
- struct archive_entry* entry;
- char* buf = NULL;
- ssize_t len;
- int fd;
- struct file_info* file;
- gchar* filename = NULL;
- gchar* msg = NULL;
#ifndef _TEST
gint num = 0;
@@ -564,6 +557,9 @@ const gchar* archive_create(const char* archive_name, GSList* files,
return archive_error_string(arch);
while (files && ! stop_action) {
+ struct file_info* file;
+ gchar* filename = NULL;
+
#ifndef _TEST
set_progress_print_all(num++, total, 30);
#endif
@@ -579,8 +575,13 @@ const gchar* archive_create(const char* archive_name, GSList* files,
#endif
}
else {
+ struct archive_entry* entry;
+ char* buf = NULL;
+ ssize_t len;
GError* err = NULL;
GStatBuf st;
+ int fd;
+ gchar* msg = NULL;
#ifndef _TEST
debug_print("Adding: %s\n", filename);