summaryrefslogtreecommitdiff
path: root/src/core/servers-setup.c
diff options
context:
space:
mode:
authorailin-nemui <ailin-nemui@users.noreply.github.com>2018-03-10 13:11:09 +0100
committerGitHub <noreply@github.com>2018-03-10 13:11:09 +0100
commit6a3a3873e9a8d905a9ed3a2656792cb94223155f (patch)
tree1704047853c97c6bd6873d3f2baa92f17ce5d535 /src/core/servers-setup.c
parent1178f753cf07cbbfd000d6b0fccf5a5dd7b54b5b (diff)
parent76d958a87fea1d744f45a9e022cf980752c7ea73 (diff)
downloadirssi-6a3a3873e9a8d905a9ed3a2656792cb94223155f.zip
Merge pull request #857 from LemonBoy/config-case
Compare channels/networks fields case-insensitively
Diffstat (limited to 'src/core/servers-setup.c')
-rw-r--r--src/core/servers-setup.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/core/servers-setup.c b/src/core/servers-setup.c
index 9492c58c..2a92a367 100644
--- a/src/core/servers-setup.c
+++ b/src/core/servers-setup.c
@@ -474,10 +474,15 @@ static int compare_server_setup (CONFIG_NODE *node, SERVER_SETUP_REC *server)
chatnet = config_node_get_str(node, "chatnet", NULL);
port = config_node_get_int(node, "port", 0);
- if (g_strcmp0(address, server->address) != 0 ||
- g_strcmp0(chatnet, server->chatnet) != 0 ||
- port != server->port)
+ if (address == NULL || chatnet == NULL) {
+ return 0;
+ }
+
+ if (g_ascii_strcasecmp(address, server->address) != 0 ||
+ g_ascii_strcasecmp(chatnet, server->chatnet) != 0 ||
+ port != server->port) {
return 1;
+ }
return 0;
}