From 0b0b4fc68d6e1fccd06679f25118fe22ed7fe1cd Mon Sep 17 00:00:00 2001 From: Baytuch Date: Tue, 20 Dec 2022 08:41:39 +0200 Subject: [PATCH] Fix generate tag from address (servers.c) --- src/core/servers.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/servers.c b/src/core/servers.c index 30fc6844..bd86840f 100644 --- a/src/core/servers.c +++ b/src/core/servers.c @@ -80,10 +80,11 @@ static char *server_create_address_tag(const char *address) start = end = NULL; } else if (g_ascii_strncasecmp(address, "irc", 3) == 0 || g_ascii_strncasecmp(address, "chat", 4) == 0) { - /* irc-2.cs.hut.fi -> hut, chat.bt.net -> bt */ - end = strrchr(address, '.'); - start = end-1; - while (start > address && *start != '.') start--; + /* irc.it-hobby.km.ua -> it-hobby, chat.bt.net -> bt */ + int offset = 3; + if (g_ascii_strncasecmp(address, "chat", 4) == 0) offset++; + end = strchr(address + offset + 1, '.'); + start = address + offset; } else { /* efnet.cs.hut.fi -> efnet */ end = strchr(address, '.');