cJSON_Utils: Fix case sensitivity handling when adding to object

This commit is contained in:
Max Bruckner 2017-06-14 17:45:44 +02:00
parent 9abe75e072
commit b9cc911831

View File

@ -942,8 +942,15 @@ static int apply_patch(cJSON *object, const cJSON *patch, const cJSON_bool case_
} }
} }
else if (cJSON_IsObject(parent)) else if (cJSON_IsObject(parent))
{
if (case_sensitive)
{
cJSON_DeleteItemFromObjectCaseSensitive(parent, (char*)child_pointer);
}
else
{ {
cJSON_DeleteItemFromObject(parent, (char*)child_pointer); cJSON_DeleteItemFromObject(parent, (char*)child_pointer);
}
cJSON_AddItemToObject(parent, (char*)child_pointer, value); cJSON_AddItemToObject(parent, (char*)child_pointer, value);
value = NULL; value = NULL;
} }