1
0
mirror of https://github.com/irssi/irssi.git synced 2024-06-23 06:35:36 +00:00

Compare commits

...

2 Commits

Author SHA1 Message Date
baytuch
f365ee77a2
Merge 0b0b4fc68d into b3f6ed0b11 2024-02-08 20:28:14 -07:00
Baytuch
0b0b4fc68d Fix generate tag from address (servers.c) 2022-12-20 08:41:39 +02:00

View File

@ -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, '.');