From 8d9b2e203a750beb1203b41172b2a87393a149e7 Mon Sep 17 00:00:00 2001 From: gunnar_g Date: Wed, 16 Feb 2011 20:57:48 +0000 Subject: [PATCH] The new zip file implementation is ready, still need to put the messages returned by it in debug mode --- src/file.c | 14 +++++++------- src/file.h | 2 +- src/load_save.c | 19 +++++++++++++++++-- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/src/file.c b/src/file.c index 74febbfd..49fbbe06 100644 --- a/src/file.c +++ b/src/file.c @@ -846,7 +846,7 @@ file_decompress(const gchar *filename) gchar *dirname = g_path_get_dirname(filename), *basename = g_path_get_basename(filename), *pwd = g_get_current_dir(); - + gchar extracted_file[256]; chdir(dirname); uLong i; @@ -861,7 +861,7 @@ file_decompress(const gchar *filename) for (i=0;istr); + chdir(dirname); + GPtrArray *files = file_dir_get_contents(dirname, prefix, ""); + // Remove the zipfile from the list + gint i; + for(i=0;ilen;i++) + { + if (g_strcmp0((gchar*)g_ptr_array_index(files, i),basename)==0){ + g_ptr_array_remove_index_fast(files, i); + } + } + file_remove_files(files); + chdir(pwd); + g_free(pwd); + free_gchar_array(&files); + misc_string_assign(&save_file, fullname);