Fix RFindCharInSet to work again. Bug 240837, r+sr=darin

git-svn-id: svn://10.0.0.236/trunk@155172 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2004-04-19 20:18:05 +00:00
parent ea1338df63
commit f6132f073a
2 changed files with 8 additions and 10 deletions

View File

@@ -127,15 +127,13 @@ nsTString_CharT::FindCharInSet( const char* aSet, PRInt32 aOffset ) const
PRInt32
nsTString_CharT::RFindCharInSet( const CharT* aSet, PRInt32 aOffset ) const
{
if (aOffset < 0)
aOffset = 0;
else if (aOffset >= PRInt32(mLength))
return kNotFound;
PRInt32 result = ::RFindCharInSet(mData + aOffset, mLength - aOffset, aSet);
if (result != kNotFound)
result += aOffset;
return result;
// We want to pass a "data length" to ::RFindCharInSet
if (aOffset < 0 || aOffset > PRInt32(mLength))
aOffset = mLength;
else
++aOffset;
return ::RFindCharInSet(mData, aOffset, aSet);
}