nsresult rv; PRInt32 colon, fSlash; PRUnichar port; nsAutoString urlSpec; convertFileToURL(nsString(aURLSpec), urlSpec);  fSlash=urlSpec.Find('/');   if ( ((colon=urlSpec.Find(':')) == -1) || ( (fSlash > -1) && (colon > fSlash) ) || ( (colon < urlSpec.Length()-1) && ((port=urlSpec.CharAt(colon+1)) <= '9') && (port > '0') )) {  int hostPos = urlSpec.FindCharInSet("./:"); if (hostPos == -1) { hostPos = urlSpec.Length(); }   nsAutoString hostSpec; urlSpec.Left(hostSpec, hostPos);   if (hostSpec.EqualsIgnoreCase("www")) { nsString ftpDef("http: urlSpec.Insert(ftpDef, 0, 7); } else if (hostSpec.EqualsIgnoreCase("ftp")) { nsString ftpDef("ftp: urlSpec.Insert(ftpDef, 0, 6); } else { nsString httpDef("http: urlSpec.Insert(httpDef, 0, 7); } }   if (nsnull != mContainer) { rv = mContainer->WillLoadURL(this, urlSpec.GetUnicode(), nsLoadURL); if (NS_FAILED(rv)) { return rv; } }  nsString* url = new nsString(urlSpec); if (aModifyHistory) {  PRInt32 i, n = mHistory.Count(); i = mHistoryIndex + 1; while (--n >= i) { nsString* u = (nsString*) mHistory.ElementAt(n); delete u; mHistory.RemoveElementAt(n); }   mHistory.AppendElement(url); mHistoryIndex++; } else {  nsString* u = (nsString*) mHistory.ElementAt(mHistoryIndex); if (nsnull != u) { delete u; } mHistory.ReplaceElementAt(url, mHistoryIndex); } ShowHistory();  return DoLoadURL(urlSpec, aCommand, aPostData, aType, aLocalIP);
return LoadURL(aURLSpec,"view",aPostData,aModifyHistory,aType, aLocalIP);
nsWebShell::LoadURL(const PRUnichar *aURLSpec,                    const char* aCommand,                    nsIPostData* aPostData,                    PRBool aModifyHistory,                    nsURLReloadType aType,                    const PRUint32 aLocalIP){  nsresult rv;  PRInt32 colon, fSlash;  PRUnichar port;  nsAutoString urlSpec;  convertFileToURL(nsString(aURLSpec), urlSpec);  fSlash=urlSpec.Find('/');  // if no scheme (protocol) is found, assume http.  if ( ((colon=urlSpec.Find(':')) == -1) // no colon at all       || ( (fSlash > -1) && (colon > fSlash) ) // the only colon comes after the first slash       || ( (colon < urlSpec.Length()-1) // the first char after the first colon is a digit (i.e. a port)            && ((port=urlSpec.CharAt(colon+1)) <= '9')            && (port > '0') )) {    // find host name    int hostPos = urlSpec.FindCharInSet("./:");    if (hostPos == -1) {      hostPos = urlSpec.Length();    }    // extract host name    nsAutoString hostSpec;    urlSpec.Left(hostSpec, hostPos);    // insert url spec corresponding to host name    if (hostSpec.EqualsIgnoreCase("www")) {      nsString ftpDef("http://");      urlSpec.Insert(ftpDef, 0, 7);    } else if (hostSpec.EqualsIgnoreCase("ftp")) {      nsString ftpDef("ftp://");      urlSpec.Insert(ftpDef, 0, 6);    } else {      nsString httpDef("http://");      urlSpec.Insert(httpDef, 0, 7);    }  }  // Give web-shell-container right of refusal  if (nsnull != mContainer) {    rv = mContainer->WillLoadURL(this, urlSpec.GetUnicode(), nsLoadURL);    if (NS_FAILED(rv)) {      return rv;    }  }  nsString* url = new nsString(urlSpec);  if (aModifyHistory) {    // Discard part of history that is no longer reachable    PRInt32 i, n = mHistory.Count();    i = mHistoryIndex + 1;    while (--n >= i) {      nsString* u = (nsString*) mHistory.ElementAt(n);      delete u;      mHistory.RemoveElementAt(n);    }    // Tack on new url    mHistory.AppendElement(url);    mHistoryIndex++;  }  else {    // Replace the current history index with this URL    nsString* u = (nsString*) mHistory.ElementAt(mHistoryIndex);    if (nsnull != u) {      delete u;    }    mHistory.ReplaceElementAt(url, mHistoryIndex);  }  ShowHistory();  return DoLoadURL(urlSpec, aCommand, aPostData, aType, aLocalIP);}