From f2e9b8b3958937ee34d183c332f3928502d39d10 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 7 Feb 2004 00:03:56 +0000 Subject: [PATCH] remove stuff from isupport always before inserting. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3225 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/irc/core/irc-servers.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/irc/core/irc-servers.c b/src/irc/core/irc-servers.c index 75b95136..235af039 100644 --- a/src/irc/core/irc-servers.c +++ b/src/irc/core/irc-servers.c @@ -614,6 +614,9 @@ static void event_isupport(IRC_SERVER_REC *server, const char *data) for(item = isupport; *item != NULL; item++) { int removed = FALSE; + if (**item == '\0') + continue; + if (**item == ':') break; @@ -634,9 +637,8 @@ static void event_isupport(IRC_SERVER_REC *server, const char *data) &key, &value) && removed) continue; - if (removed) - g_hash_table_remove(server->isupport, eptr); - else { + g_hash_table_remove(server->isupport, eptr); + if (!removed) { g_hash_table_insert(server->isupport, g_strdup(eptr), g_strdup(sptr != NULL ? sptr : "")); }