Compare channels/networks fields case-insensitively

Fixes #856
This commit is contained in:
LemonBoy 2018-03-08 20:35:00 +01:00
commit fb9f5174c2
2 changed files with 13 additions and 3 deletions

View file

@ -37,9 +37,14 @@ static int compare_channel_setup (CONFIG_NODE *node, CHANNEL_SETUP_REC *channel)
name = config_node_get_str(node, "name", NULL);
chatnet = config_node_get_str(node, "chatnet", NULL);
if (g_strcmp0(name, channel->name) != 0 ||
g_strcmp0(chatnet, channel->chatnet) != 0)
if (name == NULL || chatnet == NULL) {
return 0;
}
if (g_ascii_strcasecmp(name, channel->name) != 0 ||
g_ascii_strcasecmp(chatnet, channel->chatnet) != 0) {
return 1;
}
return 0;
}