Fail quietly when asked to read non-existent file

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@40188 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2016-11-01 21:02:31 +00:00
parent fe155240e7
commit 5c3acb5693

View file

@ -255,6 +255,11 @@ readContentsOfFile(NSString *path, void **buf, off_t *len, NSZone *zone)
}
att = [mgr fileAttributesAtPath: path traverseLink: YES];
if (nil == att)
{
return NO; // No such file ... fail quietly
}
if ([att fileType] != NSFileTypeRegular)
{
NSWarnFLog(@"Open (%@) attempt failed - not a regular file", path);