From e94dce05c692892738f418d95501594ed51bfdbd Mon Sep 17 00:00:00 2001 From: "bryner%brianryner.com" Date: Wed, 12 May 2004 19:26:30 +0000 Subject: [PATCH] Fix XPCOM_BREAK_ON_LOAD by restoring pre-string-branch Find() behavior when starting index is negative. Bug 243429, r+sr=darin --- xpcom/string/src/nsStringObsolete.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xpcom/string/src/nsStringObsolete.cpp b/xpcom/string/src/nsStringObsolete.cpp index c084fe46bdb..cc28a41d7b8 100644 --- a/xpcom/string/src/nsStringObsolete.cpp +++ b/xpcom/string/src/nsStringObsolete.cpp @@ -905,7 +905,11 @@ Find_ComputeSearchRange( PRUint32 bigLen, PRUint32 littleLen, PRInt32& offset, P { // |count| specifies how many iterations to make from |offset| - if (offset < 0 || PRUint32(offset) > bigLen) + if (offset < 0) + { + offset = 0; + } + else if (PRUint32(offset) > bigLen) { count = 0; return;