-
-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1393235 - Fix improper usages of string functions. r=njn
This fixes usages of `Find`, `RFind` and the equality operator that kind of work right now but will break with the proper type checking of a templatized version of the string classes. For `Find` and `RFind` it appears that `nsCString::(R)Find("foo", 0)` calls were being coerced to the `Find(char*, bool, int, int)` versions. The intent was probably to just start searching from position zero. For the equality operator, the type of nullptr is nullptr_t rather than char(16_t)* so we'd need to add an operator overload that takes nullptr_t. In this case just using `IsVoid` is probably more appropriate. --HG-- extra : rebase_source : 50f78519084012ca669da0a211c489520c11d6b6
- Loading branch information
Showing
4 changed files
with
5 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -706,7 +706,7 @@ nsDefaultURIFixup::FixupURIProtocol(const nsACString& aURIString, | |
// no-scheme.com/query?foo=http://www.foo.com | ||
// user:[email protected] | ||
// | ||
int32_t schemeDelim = uriString.Find("://", 0); | ||
int32_t schemeDelim = uriString.Find("://"); | ||
int32_t firstDelim = uriString.FindCharInSet("/:"); | ||
if (schemeDelim <= 0 || | ||
(firstDelim != -1 && schemeDelim > firstDelim)) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters