mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 23:38:38 +09:00
Make nsFind::Find handle empty string searches.
This commit is contained in:
parent
f7def6729d
commit
d348d327a5
1 changed files with 5 additions and 0 deletions
|
|
@ -966,6 +966,11 @@ nsFind::Find(const char16_t* aPatText, nsIDOMRange* aSearchRange,
|
|||
|
||||
const char16_t* patStr = patAutoStr.get();
|
||||
int32_t patLen = patAutoStr.Length() - 1;
|
||||
|
||||
// If this function is called with an empty string, we should early exit.
|
||||
if (patLen < 0) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// current offset into the pattern -- reset to beginning/end:
|
||||
int32_t pindex = (mFindBackward ? patLen : 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue