mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 1203861 - use strncmp() instead of nsCString.equals() to compare names r=davidb
AtkObject stores the name as a C string, but nsCString can store strings with '\0' in the middle. That means that if we compute a name containing '\0' nsCString.equals() will nevr consider that string to be equal to AtkObject::name, however we only want to compare up to the first '\0' because that is the only part Atk will ever see. So we should use strncmp() instead of nsCString.equals().
This commit is contained in:
parent
cd34e20d78
commit
5c8b5951d4
@ -597,7 +597,8 @@ static void
|
||||
MaybeFireNameChange(AtkObject* aAtkObj, const nsString& aNewName)
|
||||
{
|
||||
NS_ConvertUTF16toUTF8 newNameUTF8(aNewName);
|
||||
if (aAtkObj->name && newNameUTF8.Equals(aAtkObj->name))
|
||||
if (aAtkObj->name &&
|
||||
!strncmp(aAtkObj->name, newNameUTF8.get(), newNameUTF8.Length()))
|
||||
return;
|
||||
|
||||
// Below we duplicate the functionality of atk_object_set_name(),
|
||||
|
Loading…
Reference in New Issue
Block a user