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