summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-03-10 23:23:32 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-03-10 23:23:32 +0000
commit118aa7e88e441b31ef30bcf0876c61c367fbfaf9 (patch)
tree85474a97202bc3a74a02e6d2c5724d13289e218a /src
parentf33ec66a2718444c786f842cbbc8d8bc05b83513 (diff)
downloadirssi-118aa7e88e441b31ef30bcf0876c61c367fbfaf9.zip
nick_hash_remove(): GLIB didn't change the hash table key like I thought, so
we need to first remove it from the hash, then insert again.. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1376 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r--src/core/nicklist.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/nicklist.c b/src/core/nicklist.c
index 9689a132..c2ad44d8 100644
--- a/src/core/nicklist.c
+++ b/src/core/nicklist.c
@@ -60,11 +60,12 @@ static void nick_hash_remove(CHANNEL_REC *channel, NICK_REC *nick)
if (list == NULL)
return;
- if (list->next == NULL)
+ if (list == nick || list->next == NULL) {
g_hash_table_remove(channel->nicks, nick->nick);
- else if (list == nick) {
- g_hash_table_insert(channel->nicks, nick->next->nick,
- nick->next);
+ if (list == nick) {
+ g_hash_table_insert(channel->nicks, nick->next->nick,
+ nick->next);
+ }
} else {
while (list->next != nick)
list = list->next;