Don't try to Truncate when we fail to find the character. Actually, just do an assignment with the character location as the count size. This is actually a checkin for scc. r=travis

This commit is contained in:
tbogard%aol.net 2000-03-23 04:13:49 +00:00
Родитель 50ebcd93ee
Коммит cdd92be805
2 изменённых файлов: 4 добавлений и 8 удалений

Просмотреть файл

@ -351,10 +351,8 @@ nsresult CEndToken::Consume(PRUnichar aChar, nsScanner& aScanner,PRInt32 aMode)
nsresult result=aScanner.ReadUntil(mTextValue,kGreaterThan,PR_FALSE);
if(NS_OK==result){
PRInt32 theIndex=mTextValue.FindCharInSet(" \r\n\t\b",0);
nsAutoString buffer(mTextValue);
buffer.Truncate(theIndex);
nsAutoString buffer;
buffer.Assign(mTextValue, mTextValue.FindCharInSet(" \r\n\t\b",0));
mTypeID= nsHTMLTags::LookupTag(buffer);
result=aScanner.GetChar(aChar); //eat the closing '>;
}

Просмотреть файл

@ -351,10 +351,8 @@ nsresult CEndToken::Consume(PRUnichar aChar, nsScanner& aScanner,PRInt32 aMode)
nsresult result=aScanner.ReadUntil(mTextValue,kGreaterThan,PR_FALSE);
if(NS_OK==result){
PRInt32 theIndex=mTextValue.FindCharInSet(" \r\n\t\b",0);
nsAutoString buffer(mTextValue);
buffer.Truncate(theIndex);
nsAutoString buffer;
buffer.Assign(mTextValue, mTextValue.FindCharInSet(" \r\n\t\b",0));
mTypeID= nsHTMLTags::LookupTag(buffer);
result=aScanner.GetChar(aChar); //eat the closing '>;
}