From 071c2f1c20af617ce3a73b2ab5fde2b9b85c07a4 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sun, 22 Oct 2023 19:25:52 +0000 Subject: [PATCH] This looks like it could miss files on import. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4573 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- src/ssb.import.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ssb.import.c b/src/ssb.import.c index eca5d30a..a03edd30 100644 --- a/src/ssb.import.c +++ b/src/ssb.import.c @@ -284,7 +284,7 @@ static void _tf_ssb_import_recursive_add_files_from_zip(tf_ssb_t* ssb, unzFile z { if (unzGoToFirstFile(zip) == UNZ_OK) { - while (unzGoToNextFile(zip) == UNZ_OK) + do { char file_path[256]; unz_file_info64 info = { 0 }; @@ -307,6 +307,7 @@ static void _tf_ssb_import_recursive_add_files_from_zip(tf_ssb_t* ssb, unzFile z } } } + while (unzGoToNextFile(zip) == UNZ_OK); } } @@ -359,7 +360,7 @@ void tf_ssb_import_from_zip(tf_ssb_t* ssb, const char* zip_path, const char* use tf_printf("Importing from %s.\n", zip_path); if (unzGoToFirstFile(zip) == UNZ_OK) { - while (unzGoToNextFile(zip) == UNZ_OK) + do { char file_path[256]; unz_file_info64 info = { 0 }; @@ -377,6 +378,7 @@ void tf_ssb_import_from_zip(tf_ssb_t* ssb, const char* zip_path, const char* use } } } + while (unzGoToNextFile(zip) == UNZ_OK); } unzClose(zip); }