зеркало из https://github.com/mozilla/gecko-dev.git
Bug 652186 - Remove unneeded backslash replacement from nsDefaultURIFixup r=bz
MozReview-Commit-ID: 5IPxr8nWk7b --HG-- extra : rebase_source : fce3dd4732d313337cdf210770233d54457ddac7
This commit is contained in:
Родитель
ef156107f8
Коммит
d77d9c2af1
|
@ -222,45 +222,6 @@ nsDefaultURIFixup::GetFixupURIInfo(const nsACString& aStringURI,
|
|||
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) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче