forked from PsychoticNinja/irssi
Merge pull request #442 from LemonBoy/fix-435
Do not assume any default value for statusmsg.
This commit is contained in:
parent
15296a0165
commit
fe600dd5dc
@ -78,17 +78,23 @@ static int ischannel_func(SERVER_REC *server, const char *data)
|
|||||||
IRC_SERVER_REC *irc_server = (IRC_SERVER_REC *) server;
|
IRC_SERVER_REC *irc_server = (IRC_SERVER_REC *) server;
|
||||||
char *chantypes, *statusmsg;
|
char *chantypes, *statusmsg;
|
||||||
|
|
||||||
|
g_return_val_if_fail(data != NULL, FALSE);
|
||||||
|
|
||||||
|
/* empty string is no channel */
|
||||||
|
if (*data == '\0')
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
chantypes = g_hash_table_lookup(irc_server->isupport, "chantypes");
|
chantypes = g_hash_table_lookup(irc_server->isupport, "chantypes");
|
||||||
if (chantypes == NULL)
|
if (chantypes == NULL)
|
||||||
chantypes = "#&!+"; /* normal, local, secure, modeless */
|
chantypes = "#&!+"; /* normal, local, secure, modeless */
|
||||||
|
|
||||||
statusmsg = g_hash_table_lookup(irc_server->isupport, "statusmsg");
|
statusmsg = g_hash_table_lookup(irc_server->isupport, "statusmsg");
|
||||||
if (statusmsg == NULL)
|
if (statusmsg != NULL)
|
||||||
statusmsg = "@+";
|
data += strspn(data, statusmsg);
|
||||||
|
|
||||||
while (strchr(statusmsg, *data) != NULL)
|
/* strchr(3) considers the trailing NUL as part of the string, make sure
|
||||||
data++;
|
* we didn't advance too much. */
|
||||||
|
return *data != '\0' && strchr(chantypes, *data) != NULL;
|
||||||
return strchr(chantypes, *data) != NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static char **split_line(const SERVER_REC *server, const char *line,
|
static char **split_line(const SERVER_REC *server, const char *line,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user