fixed edge case in entity reduction code

git-svn-id: svn://10.0.0.236/trunk@69847 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rickg%netscape.com
2000-05-15 20:37:01 +00:00
parent f9211ed0e5
commit 44ebbe32f8
2 changed files with 20 additions and 4 deletions

View File

@@ -676,10 +676,18 @@ void HTMLContentSink::ReduceEntities(nsString& aString) {
dtd->ConvertEntityToUnicode(theNCRStr, &theNCRValue);
theEntity=PRUnichar(theNCRValue);
}
else {
//what looked like an entity is not really one.
//so let's copy the ncrstring back to the output string
aString.Mid(theNCRStr,theAmpPos,theSemiPos-theAmpPos+1);
theOutString.Append(theNCRStr);
}
break;
} //switch
theOutString.Append(theEntity);
if(theEntity) {
theOutString.Append(theEntity);
}
theAmpPos = aString.FindChar('&',PR_FALSE,theSemiPos+1);
} //while