From 8d993704e78b3db5bc563b046f2f3e3bb6aa9aa5 Mon Sep 17 00:00:00 2001 From: Jamiras Date: Tue, 15 Mar 2022 09:15:48 -0600 Subject: [PATCH] report error when zip contains multiple files --- src/Application.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Application.cpp b/src/Application.cpp index 23f0053..d6f2f11 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -1027,7 +1027,7 @@ bool Application::loadGame(const std::string& path) /* when a core needs fullpath for a zip file, RetroArch unzips the zip file (unless blocked by the core) */ if (!info->block_extract) { - _logger.debug(TAG "%s requires uncompressed content - extracting", info->library_name); + _logger.info(TAG "%s requires uncompressed content - extracting", info->library_name); data = util::loadZippedFile(&_logger, path, &size, unzippedFileName); if (data == NULL) @@ -1036,6 +1036,12 @@ bool Application::loadGame(const std::string& path) return false; } + if (unzippedFileName.empty()) + { + MessageBox(g_mainWindow, "Could not determine which file to extract from zip", "Error", MB_OK); + return false; + } + std::string newPath = util::replaceFileName(path, unzippedFileName.c_str()); util::saveFile(&_logger, newPath, data, size); free(data);