fixes bug 235355 "hangs/crashes after choosing Server Settings in Mail&Newsgroup Account Settings, click o.k." r+sr=dbaron

git-svn-id: svn://10.0.0.236/trunk@153194 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
darin%meer.net
2004-02-25 03:24:29 +00:00
parent 6adc6f124a
commit 118c2a873e
2 changed files with 82 additions and 8 deletions

View File

@@ -378,18 +378,18 @@ nsTString_CharT::ReplaceSubstring( const char_type* aTarget, const char_type* aN
void
nsTString_CharT::ReplaceSubstring( const self_type& aTarget, const self_type& aNewValue )
{
PRInt32 i = 0;
if (aTarget.Length() == 0)
return;
// XXX is this right?
while (PRUint32(i) < mLength)
PRUint32 i = 0;
while (i < mLength)
{
PRInt32 r = FindSubstring(mData + i, mLength - i, aTarget.Data(), aTarget.Length(), PR_FALSE);
if (r == kNotFound)
break;
Replace(i + r, aTarget.Length(), aNewValue);
i += aNewValue.Length();
i += r + aNewValue.Length();
}
}