Avoid “cannot iterate into directory” messages for nonexistent AddOns directories.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1672 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
Jens Ayton 2008-06-04 17:36:51 +00:00
parent baf76050ff
commit ea6fe98212

View File

@ -177,21 +177,24 @@ static NSMutableDictionary *string_cache;
for (pathEnum = [rootPaths objectEnumerator]; (root = [pathEnum nextObject]); )
{
// Iterate over each root path's contents
for (dirEnum = [fmgr enumeratorAtPath:root]; (subPath = [dirEnum nextObject]); )
if ([fmgr fileExistsAtPath:root isDirectory:&isDirectory] && isDirectory)
{
// Check if it's a directory
path = [root stringByAppendingPathComponent:subPath];
if ([fmgr fileExistsAtPath:path isDirectory:&isDirectory] && isDirectory)
for (dirEnum = [fmgr enumeratorAtPath:root]; (subPath = [dirEnum nextObject]); )
{
// If it is, is it an OXP?
if ([[[path pathExtension] lowercaseString] isEqualToString:@"oxp"])
// Check if it's a directory
path = [root stringByAppendingPathComponent:subPath];
if ([fmgr fileExistsAtPath:path isDirectory:&isDirectory] && isDirectory)
{
[self checkPotentialPath:path :sSearchPaths];
}
else
{
// If not, don't search subdirectories
[dirEnum skipDescendents];
// If it is, is it an OXP?
if ([[[path pathExtension] lowercaseString] isEqualToString:@"oxp"])
{
[self checkPotentialPath:path :sSearchPaths];
}
else
{
// If not, don't search subdirectories
[dirEnum skipDescendents];
}
}
}
}