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

This commit is contained in:
nisheeth%netscape.com 1999-07-16 22:45:38 +00:00
parent a4bb19abc2
commit 4b73654f45
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

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