File manager fix

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@6617 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2000-05-24 09:08:32 +00:00
parent d9201252dc
commit cf04801a9a

View file

@ -508,7 +508,7 @@ static NSFileManager* defaultManager = nil;
{
NSArray *contents;
if (handler)
if (handler != nil)
[handler fileManager: self willProcessPath: path];
contents = [self directoryContentsAtPath: path];
@ -1047,11 +1047,17 @@ static NSFileManager* defaultManager = nil;
{
NSDirectoryEnumerator *direnum;
NSMutableArray *content;
BOOL isDir;
IMP nxtImp;
IMP addImp;
if (![self fileExistsAtPath: path isDirectory: &isDir] || !isDir)
NSDictionary *attr;
NSString *type;
/*
* See if this is a directory (don't follow links).
*/
attr = [self fileAttributesAtPath: path traverseLink: NO];
type = [attr objectForKey: NSFileType];
if ([type isEqualToString: NSFileTypeDirectory] == NO)
return nil;
direnum = [[NSDirectoryEnumerator alloc] initWithDirectoryPath: path