Don't try to set alternate_nick to any default value, it's not very useful

and it didn't work properly if nick was 9 chars with last char being '_'
(not very likely though :). Also handle properly the situation where nick
and alternate_nick are the same.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2311 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2002-01-12 12:03:00 +00:00 committed by cras
commit e6bf76ed11
2 changed files with 3 additions and 15 deletions

View file

@ -255,8 +255,9 @@ static void event_nick_in_use(IRC_SERVER_REC *server, const char *data)
}
/* nick already in use - need to change it .. */
if (strcmp(server->nick, server->connrec->nick) == 0 &&
server->connrec->alternate_nick != NULL) {
if (g_strcasecmp(server->nick, server->connrec->nick) == 0 &&
server->connrec->alternate_nick != NULL &&
g_strcasecmp(server->connrec->alternate_nick, server->nick) != 0) {
/* first try, so try the alternative nick.. */
g_free(server->nick);
server->nick = g_strdup(server->connrec->alternate_nick);