From bf0a142c90b0811a1db5811a4f0f9fde645835fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesu=CC=81s=20A=2E=20A=CC=81lvarez?= Date: Thu, 26 May 2016 21:19:42 +0200 Subject: [PATCH] allow mixed case ROM file name and initial disk images --- Mini vMac/MYOSGLUE.m | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Mini vMac/MYOSGLUE.m b/Mini vMac/MYOSGLUE.m index 068d1c1..f12dcad 100644 --- a/Mini vMac/MYOSGLUE.m +++ b/Mini vMac/MYOSGLUE.m @@ -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; }