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);