Fix #8219: Faulty folder recreation in "save" folder

This commit is contained in:
hokasha2016 2019-03-28 15:20:01 -04:00 committed by Michael Steenbeek
parent c01cfbdc26
commit 70ae847a72
1 changed files with 1 additions and 8 deletions

View File

@ -240,17 +240,10 @@ static const char* getFilterPatternByType(const int32_t type, const bool isSave)
static int32_t window_loadsave_get_dir(const int32_t type, char* path, size_t pathSize)
{
const char* last_save = getLastDirectoryByType(type);
if (last_save && platform_ensure_directory_exists(last_save))
if (last_save != nullptr && platform_directory_exists(last_save))
safe_strcpy(path, last_save, pathSize);
else
getInitialDirectoryByType(type, path, pathSize);
if (!platform_ensure_directory_exists(path))
{
log_error("Unable to create save directory.");
return 0;
}
return 1;
}