diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index d03c75f1166..d857efab873 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -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); diff --git a/mozilla/modules/libjar/nsJARChannel.cpp b/mozilla/modules/libjar/nsJARChannel.cpp index fc4ce29403d..9c54464f33f 100644 --- a/mozilla/modules/libjar/nsJARChannel.cpp +++ b/mozilla/modules/libjar/nsJARChannel.cpp @@ -163,7 +163,13 @@ nsJARInputThunk::EnsureJarStream() rv = mJarReader->GetInputStream(mJarEntry.get(), getter_AddRefs(mJarStream)); } - if (NS_FAILED(rv)) return rv; + if (NS_FAILED(rv)) { + // convert to the proper result if the entry wasn't found + // so that error pages work + if (rv == NS_ERROR_FILE_TARGET_DOES_NOT_EXIST) + rv = NS_ERROR_FILE_NOT_FOUND; + return rv; + } // ask the JarStream for the content length mJarStream->Available((PRUint32 *) &mContentLength);