bug# 9221 Fixing autoreg terminating on bad aliases. We now let it go

as far as possible ignoring errors. r=sfraser
This commit is contained in:
dp%netscape.com 1999-10-22 06:32:26 +00:00
Родитель ea0ac2fecc
Коммит cf16f4e92d
1 изменённых файлов: 17 добавлений и 27 удалений

Просмотреть файл

@ -302,35 +302,25 @@ nsNativeComponentLoader::RegisterComponentsInDir(PRInt32 when,
while (more == PR_TRUE)
{
rv = dirIterator->GetCurrentSpec(&dirEntry);
if (NS_FAILED(rv)) return rv;
rv = dirEntry->IsDirectory(&isDir);
if (NS_FAILED(rv)) return rv;
if (isDir == PR_TRUE)
if (NS_SUCCEEDED(rv))
{
// This is a directory. Grovel for components into the directory.
rv = RegisterComponentsInDir(when, dirEntry);
rv = dirEntry->IsDirectory(&isDir);
if (NS_SUCCEEDED(rv))
{
if (isDir == PR_TRUE)
{
// This is a directory. Grovel for components into the directory.
rv = RegisterComponentsInDir(when, dirEntry);
}
else
{
PRBool registered;
// This is a file. Try to register it.
rv = AutoRegisterComponent(when, dirEntry, &registered);
}
}
NS_RELEASE(dirEntry);
}
else
{
PRBool registered;
// This is a file. Try to register it.
rv = AutoRegisterComponent(when, dirEntry, &registered);
}
if (NS_FAILED(rv))
{
// This means either of AutoRegisterComponent or
// SyncComponentsInDir failed. It could be because
// the file isn't a component like initpref.js
// So dont break on these errors.
// Update: actually, we return NS_OK for the wrong file
// types, but we should never fail hard because just one
// component didn't work.
}
NS_RELEASE(dirEntry);
rv = dirIterator->Next();
if (NS_FAILED(rv)) return rv;
rv = dirIterator->Exists(&more);