api clean up and fixed a blah.com www. appending case

git-svn-id: svn://10.0.0.236/trunk@57715 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
valeski%netscape.com
2000-01-13 23:23:20 +00:00
parent 8cb3795a6a
commit 27da90e53c
2 changed files with 14 additions and 8 deletions

View File

@@ -1958,7 +1958,7 @@ nsWebShell::LoadURL(const PRUnichar *aURLSpec,
if (NS_FAILED(rv)) {
// no dice.
nsAutoString urlSpec;
urlStr.Trim(" ", PR_TRUE, PR_TRUE);
urlStr.Trim(" ");
// see if we've got a file url.
convertFileToURL(urlStr, urlSpec);
@@ -3142,9 +3142,12 @@ nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader,
retryHost = "www.";
retryHost += hostStr;
retryHost += ".com";
} else if ( (hostStr.Length() - dotLoc) == 3) {
retryHost = "www.";
retryHost += hostStr;
} else {
PRInt32 hostLen = hostStr.Length();
if ( ((hostLen - dotLoc) == 3) || ((hostLen - dotLoc) == 4) ) {
retryHost = "www.";
retryHost += hostStr;
}
}
if (!retryHost.IsEmpty()) {