Mac: Fix creating support folders when they don't exist

This commit is contained in:
Michael Buckley 2019-11-11 19:24:08 -08:00
parent 6582af1094
commit ca52af63f4
1 changed files with 9 additions and 14 deletions

View File

@ -131,23 +131,18 @@ static NSURL *FindApplicationSupportFolder (const char *folderName)
{
purl = [s9xURL URLByAppendingPathComponent:fstr];
}
else
else if ([NSFileManager.defaultManager fileExistsAtPath:oldURL.path])
{
if ([NSFileManager.defaultManager fileExistsAtPath:oldURL.path])
{
purl = [oldURL URLByAppendingPathComponent:fstr];
}
else
{
NSError *error = nil;
if ([NSFileManager.defaultManager createDirectoryAtURL:s9xURL withIntermediateDirectories:YES attributes:nil error:&error])
{
purl = [s9xURL URLByAppendingPathComponent:fstr];
AddFolderIcon(purl, folderName);
}
}
purl = [oldURL URLByAppendingPathComponent:fstr];
}
if (purl == NULL)
{
purl = [s9xURL URLByAppendingPathComponent:fstr];
}
[NSFileManager.defaultManager createDirectoryAtURL:purl withIntermediateDirectories:YES attributes:nil error:NULL];
return purl;
}