Follow-up to fix for bug 10456. I made the earlier changes to the non-Necko part of the code! Making the same changes to the ifdef NECKO part.

This commit is contained in:
nisheeth%netscape.com 1999-10-26 02:42:23 +00:00
Родитель d12a104ab3
Коммит 6615ece773
2 изменённых файлов: 48 добавлений и 32 удалений

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

@ -531,21 +531,29 @@ nsExpatTokenizer::OpenInputStream(const nsString& aURLStr,
} }
} }
#else // NECKO #else // NECKO
nsIURI* uri; nsCOMPtr<nsIURI> baseURI;
nsIURI* baseURI; rv = NS_NewURI(getter_AddRefs(baseURI), aBaseURL);
if (NS_SUCCEEDED(rv) && nsnull != baseURI) {
rv = NS_NewURI(&baseURI, aBaseURL); nsCOMPtr<nsIURI> uri = nsnull;
if (NS_SUCCEEDED(rv)) { rv = NS_NewURI(getter_AddRefs(uri), aURLStr, baseURI);
rv = NS_NewURI(&uri, aURLStr, baseURI); if (NS_SUCCEEDED(rv) && nsnull != uri) {
if (NS_SUCCEEDED(rv)) { char* scheme = nsnull;
rv = uri->GetScheme(&scheme);
if (NS_SUCCEEDED(rv) &&
nsnull != scheme &&
PL_strcmp(scheme, kChromeProtocol) == 0 )
{
rv = NS_OpenURI(in, uri); rv = NS_OpenURI(in, uri);
char* absURL = nsnull; char* absURL = nsnull;
uri->GetSpec(&absURL); uri->GetSpec(&absURL);
aAbsURL->Append(absURL); aAbsURL->Append(absURL);
nsCRT::free(absURL); nsCRT::free(absURL);
NS_RELEASE(uri);
} }
NS_RELEASE(baseURI); else {
rv = NS_ERROR_NOT_IMPLEMENTED;
}
if (scheme) nsCRT::free(scheme);
}
} }
#endif // NECKO #endif // NECKO
return rv; return rv;

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

@ -531,21 +531,29 @@ nsExpatTokenizer::OpenInputStream(const nsString& aURLStr,
} }
} }
#else // NECKO #else // NECKO
nsIURI* uri; nsCOMPtr<nsIURI> baseURI;
nsIURI* baseURI; rv = NS_NewURI(getter_AddRefs(baseURI), aBaseURL);
if (NS_SUCCEEDED(rv) && nsnull != baseURI) {
rv = NS_NewURI(&baseURI, aBaseURL); nsCOMPtr<nsIURI> uri = nsnull;
if (NS_SUCCEEDED(rv)) { rv = NS_NewURI(getter_AddRefs(uri), aURLStr, baseURI);
rv = NS_NewURI(&uri, aURLStr, baseURI); if (NS_SUCCEEDED(rv) && nsnull != uri) {
if (NS_SUCCEEDED(rv)) { char* scheme = nsnull;
rv = uri->GetScheme(&scheme);
if (NS_SUCCEEDED(rv) &&
nsnull != scheme &&
PL_strcmp(scheme, kChromeProtocol) == 0 )
{
rv = NS_OpenURI(in, uri); rv = NS_OpenURI(in, uri);
char* absURL = nsnull; char* absURL = nsnull;
uri->GetSpec(&absURL); uri->GetSpec(&absURL);
aAbsURL->Append(absURL); aAbsURL->Append(absURL);
nsCRT::free(absURL); nsCRT::free(absURL);
NS_RELEASE(uri);
} }
NS_RELEASE(baseURI); else {
rv = NS_ERROR_NOT_IMPLEMENTED;
}
if (scheme) nsCRT::free(scheme);
}
} }
#endif // NECKO #endif // NECKO
return rv; return rv;