added http:// assumption code to the webshell (removed it from the viewer) to move the functionality downward.

git-svn-id: svn://10.0.0.236/branches/NGLayoutStability_BRANCH@7633 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
valeski%netscape.com
1998-08-09 17:53:30 +00:00
parent fdfd5414c3
commit 1bb3ca6b58
2 changed files with 32 additions and 0 deletions

View File

@@ -797,6 +797,22 @@ nsWebShell::GetDocumentLoader(nsIDocumentLoader*& aResult)
static void convertFileToURL(nsString &aIn, nsString &aOut)
{
#ifdef XP_PC
PRInt32 colon, fSlash;
PRUnichar port;
nsAutoString urlSpec(aURLSpec);
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') )
) {
nsString httpDef("http://");
urlSpec.Insert(httpDef, 0, 7);
}
char szFile[1000];
aIn.ToCString(szFile, sizeof(szFile));
if (PL_strchr(szFile, '\\')) {

View File

@@ -797,6 +797,22 @@ nsWebShell::GetDocumentLoader(nsIDocumentLoader*& aResult)
static void convertFileToURL(nsString &aIn, nsString &aOut)
{
#ifdef XP_PC
PRInt32 colon, fSlash;
PRUnichar port;
nsAutoString urlSpec(aURLSpec);
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') )
) {
nsString httpDef("http://");
urlSpec.Insert(httpDef, 0, 7);
}
char szFile[1000];
aIn.ToCString(szFile, sizeof(szFile));
if (PL_strchr(szFile, '\\')) {