Bug 652186 - Remove unneeded backslash replacement from nsDefaultURIFixup r?bz
MozReview-Commit-ID: 5IPxr8nWk7b
--- a/docshell/base/nsDefaultURIFixup.cpp
+++ b/docshell/base/nsDefaultURIFixup.cpp
@@ -217,55 +217,16 @@ nsDefaultURIFixup::GetFixupURIInfo(const
// NB: FileURIFixup only returns a URI if it had to fix the protocol to
// do so, so passing in file:///foo/bar will not hit this path:
if (uri) {
uri.swap(info->mFixedURI);
info->mPreferredURI = info->mFixedURI;
info->mFixupChangedProtocol = true;
return NS_OK;
}
-
-#if defined(XP_WIN)
- // Not a file URL, so translate '\' to '/' for convenience in the common
- // protocols. E.g. catch
- //
- // http:\\broken.com\address
- // http:\\broken.com/blah
- // broken.com\blah
- //
- // Code will also do partial fix up the following urls
- //
- // http:\\broken.com\address/somewhere\image.jpg (stops at first forward slash)
- // http:\\broken.com\blah?arg=somearg\foo.jpg (stops at question mark)
- // http:\\broken.com#odd\ref (stops at hash)
- //
- if (scheme.IsEmpty() ||
- scheme.LowerCaseEqualsLiteral("http") ||
- scheme.LowerCaseEqualsLiteral("https") ||
- scheme.LowerCaseEqualsLiteral("ftp")) {
- // Walk the string replacing backslashes with forward slashes until
- // the end is reached, or a question mark, or a hash, or a forward
- // slash. The forward slash test is to stop before trampling over
- // URIs which legitimately contain a mix of both forward and
- // backward slashes.
- nsAutoCString::iterator start;
- nsAutoCString::iterator end;
- uriString.BeginWriting(start);
- uriString.EndWriting(end);
- while (start != end) {
- if (*start == '?' || *start == '#' || *start == '/') {
- break;
- }
- if (*start == '\\') {
- *start = '/';
- }
- ++start;
- }
- }
-#endif
}
if (!sInitializedPrefCaches) {
// Check if we want to fix up common scheme typos.
rv = Preferences::AddBoolVarCache(&sFixTypos,
"browser.fixup.typo.scheme",
sFixTypos);
MOZ_ASSERT(NS_SUCCEEDED(rv),