Fix regression from bug 281666 address book string prefs were being unnecessarily set. r/sr=bienvenu

This commit is contained in:
bugzilla%standard8.demon.co.uk 2005-12-29 19:48:07 +00:00
parent 05207134f2
commit e756ce4c1a

View File

@ -2985,14 +2985,14 @@ static void DIR_SetStringPref(const char *prefRoot, const char *prefLeaf, const
nsXPIDLCString userPref;
if (NS_SUCCEEDED(pPref->GetCharPref (prefLocation.get(), getter_Copies(userPref))))
{
if (value && (defaultValue ? nsCRT::strcasecmp(prefLocation.get(), defaultValue) : value != defaultValue))
if (value && (defaultValue ? nsCRT::strcasecmp(value, defaultValue) : value != defaultValue))
rv = pPref->SetCharPref (prefLocation.get(), value);
else
rv = pPref->ClearUserPref(prefLocation.get());
}
else
{
if (value && (defaultValue ? nsCRT::strcasecmp(prefLocation.get(), defaultValue) : value != defaultValue))
if (value && (defaultValue ? nsCRT::strcasecmp(value, defaultValue) : value != defaultValue))
rv = pPref->SetCharPref (prefLocation.get(), value);
}
}