Skip to content

Commit

Permalink
Ensured we get a read handle if we can't get one for updating.
Browse files Browse the repository at this point in the history
  • Loading branch information
TomHarte authored and Thomas Harte committed Sep 30, 2015
1 parent 1b32e66 commit eda25ab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CPM for OS X/BDOS/BDOS.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}];
}

Expand Down

0 comments on commit eda25ab

Please sign in to comment.