From d5d48228b3187ab4c60f605bfdf326f5e1644370 Mon Sep 17 00:00:00 2001 From: Alex Taber Date: Thu, 31 Aug 2017 22:28:52 -0400 Subject: [PATCH] Fix preview loading for Preview.png --- source/fs.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/fs.c b/source/fs.c index ffaa8b1..09b7bc8 100644 --- a/source/fs.c +++ b/source/fs.c @@ -24,11 +24,18 @@ * reasonable ways as different from the original version. */ +#include + #include "fs.h" #include "unicode.h" #include "minizip/unzip.h" +int filename_compare(unzFile file, const char *current_filename, const char *filename) +{ + return strcasecmp(current_filename, filename); +} + Result open_archives(void) { @@ -122,7 +129,7 @@ u32 zip_file_to_buf(char *file_name, u16 *zip_path, char **buf) if (zip_handle == NULL) return 0; u32 file_size = 0; - int status = unzLocateFile(zip_handle, file_name, 0); + int status = unzLocateFile(zip_handle, file_name, filename_compare); if (status == UNZ_OK) { unz_file_info *file_info = malloc(sizeof(unz_file_info));