mirror of
https://github.com/zydeco/minivmac4ios.git
synced 2024-11-26 00:49:20 +00:00
allow mixed case ROM file name and initial disk images
This commit is contained in:
parent
061ac16a0a
commit
bf0a142c90
@ -102,8 +102,15 @@ LOCALFUNC blnr FindNamedChildFilePath(NSString *parentPath, char *ChildName, NSS
|
||||
NSFileManager *fm = [NSFileManager defaultManager];
|
||||
BOOL isDirectory;
|
||||
if ([fm fileExistsAtPath:parentPath isDirectory:&isDirectory] && isDirectory) {
|
||||
*childPath = [parentPath stringByAppendingPathComponent:@(ChildName)];
|
||||
return trueblnr;
|
||||
NSString *searchString = @(ChildName).lowercaseString;
|
||||
*childPath = NULL;
|
||||
[[fm contentsOfDirectoryAtPath:parentPath error:NULL] enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if ([obj.lowercaseString isEqualToString:searchString]) {
|
||||
*stop = YES;
|
||||
*childPath = [parentPath stringByAppendingPathComponent:obj];
|
||||
}
|
||||
}];
|
||||
return *childPath != NULL;
|
||||
} else {
|
||||
return falseblnr;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user