Bug 26496 - Jar protocol fails silently on file-not-found. r=darin, sr=bz

git-svn-id: svn://10.0.0.236/trunk@207150 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
jwalden%mit.edu
2006-08-11 18:36:32 +00:00
parent 076ac01f83
commit 6a5928f06a
2 changed files with 17 additions and 2 deletions

View File

@@ -2949,7 +2949,16 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI *aURI,
else if (NS_ERROR_FILE_NOT_FOUND == aError) {
NS_ENSURE_ARG_POINTER(aURI);
nsCAutoString spec;
aURI->GetPath(spec);
// displaying "file://" is aesthetically unpleasing and could even be
// confusing to the user
PRBool isFileURI = PR_FALSE;
rv = aURI->SchemeIs("file", &isFileURI);
if (NS_FAILED(rv))
return rv;
if (isFileURI)
aURI->GetPath(spec);
else
aURI->GetSpec(spec);
nsCAutoString charset;
// unescape and convert from origin charset
aURI->GetOriginCharset(charset);