mirror of
https://github.com/irssi/irssi.git
synced 2025-01-03 14:56:47 -05:00
/FOREACH won't crash now if the command removes the item being accessed
(ie. /foreach server disconnect should work) git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1625 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
c930f8f8e6
commit
bcbb55dd1e
@ -320,20 +320,23 @@ static void cmd_foreach(const char *data, SERVER_REC *server,
|
||||
/* SYNTAX: FOREACH SERVER <command> */
|
||||
static void cmd_foreach_server(const char *data, SERVER_REC *server)
|
||||
{
|
||||
GSList *tmp;
|
||||
GSList *tmp, *next;
|
||||
|
||||
for (tmp = servers; tmp != NULL; tmp = tmp->next)
|
||||
for (tmp = servers; tmp != NULL; tmp = next) {
|
||||
next = tmp->next;
|
||||
signal_emit("send command", 3, data, tmp->data, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/* SYNTAX: FOREACH CHANNEL <command> */
|
||||
static void cmd_foreach_channel(const char *data)
|
||||
{
|
||||
GSList *tmp;
|
||||
GSList *tmp, *next;
|
||||
|
||||
for (tmp = channels; tmp != NULL; tmp = tmp->next) {
|
||||
for (tmp = channels; tmp != NULL; tmp = next) {
|
||||
CHANNEL_REC *rec = tmp->data;
|
||||
|
||||
next = tmp->next;
|
||||
signal_emit("send command", 3, data, rec->server, rec);
|
||||
}
|
||||
}
|
||||
@ -341,11 +344,12 @@ static void cmd_foreach_channel(const char *data)
|
||||
/* SYNTAX: FOREACH QUERY <command> */
|
||||
static void cmd_foreach_query(const char *data)
|
||||
{
|
||||
GSList *tmp;
|
||||
GSList *tmp, *next;
|
||||
|
||||
for (tmp = queries; tmp != NULL; tmp = tmp->next) {
|
||||
for (tmp = queries; tmp != NULL; tmp = next) {
|
||||
QUERY_REC *rec = tmp->data;
|
||||
|
||||
next = tmp->next;
|
||||
signal_emit("send command", 3, data, rec->server, rec);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user