From eda25abd3d199316b20c9a8df96cc64302a68216 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 29 Sep 2015 22:04:09 -0400 Subject: [PATCH] Ensured we get a read handle if we can't get one for updating. --- CPM for OS X/BDOS/BDOS.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CPM for OS X/BDOS/BDOS.m b/CPM for OS X/BDOS/BDOS.m index c553882..e68cd4d 100644 --- a/CPM for OS X/BDOS/BDOS.m +++ b/CPM for OS X/BDOS/BDOS.m @@ -517,7 +517,9 @@ - (BOOL)renameFileWithParameter:(uint16_t)parameter - (BOOL)openFileWithParameter:(uint16_t)parameter { return [self establishHandleWithParameter:parameter creator:^NSFileHandle *(NSString *path) { - return [NSFileHandle fileHandleForUpdatingAtPath:path]; + NSFileHandle *readWriteHandle = [NSFileHandle fileHandleForUpdatingAtPath:path]; + if(readWriteHandle) return readWriteHandle; + return [NSFileHandle fileHandleForReadingAtPath:path]; }]; }