Skip to content

Commit

Permalink
report error when zip contains multiple files
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamiras committed Mar 15, 2022
1 parent a87624a commit 8d99370
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
Expand Down

0 comments on commit 8d99370

Please sign in to comment.