Fix for bug 9255. We were not trimming leading and trailing whitespace from the url typed in the location bar. Now we do.

git-svn-id: svn://10.0.0.236/trunk@39778 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
nisheeth%netscape.com
1999-07-16 22:45:38 +00:00
parent 98abd26e0d
commit 4db2f3e951
2 changed files with 12 additions and 2 deletions

View File

@@ -1953,15 +1953,20 @@ nsWebShell::LoadURL(const PRUnichar *aURLSpec,
{
nsresult rv;
nsAutoString urlSpec;
convertFileToURL(nsString(aURLSpec), urlSpec);
nsString urlStr = aURLSpec;
urlStr.Trim(" ", PR_TRUE, PR_TRUE);
convertFileToURL(urlStr, urlSpec);
//#ifdef NECKO
// nsCOMPtr<nsIURI> url;
// rv = NS_NewURI(getter_AddRefs(url), urlSpec);
// if (NS_FAILED(rv)) return rv;
//#else
PRInt32 colon, fSlash;
PRUnichar port;
fSlash=urlSpec.Find('/');
// if no scheme (protocol) is found, assume http.
if ( ((colon=urlSpec.Find(':')) == -1) // no colon at all