diff options
author | Timo Sirainen <cras@irssi.org> | 2001-07-15 18:21:44 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-07-15 18:21:44 +0000 |
commit | 27fcabbc1965e9d7836f6e196ed2019a215bbe91 (patch) | |
tree | bbcc1e7674ac6bf18ef3514cc06b12f52831491f /src | |
parent | fd547c3ebe322316501ef4ba996f5de94550b29f (diff) | |
download | irssi-27fcabbc1965e9d7836f6e196ed2019a215bbe91.zip |
Previous foreach fixes to /FOREACH WINDOW too.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1632 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r-- | src/fe-common/core/window-commands.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/fe-common/core/window-commands.c b/src/fe-common/core/window-commands.c index 99af8e77..c158ba39 100644 --- a/src/fe-common/core/window-commands.c +++ b/src/fe-common/core/window-commands.c @@ -517,16 +517,20 @@ static void cmd_layout(const char *data, SERVER_REC *server, WI_ITEM_REC *item) static void cmd_foreach_window(const char *data) { WINDOW_REC *old; - GSList *tmp; + GSList *list; old = active_win; - for (tmp = windows; tmp != NULL; tmp = tmp->next) { - WINDOW_REC *rec = tmp->data; - active_win = rec; + list = g_slist_copy(windows); + while (list != NULL) { + WINDOW_REC *rec = list->data; + + active_win = rec; signal_emit("send command", 3, data, rec->active_server, rec->active); + list = g_slist_remove(list, list->data); } + active_win = old; } |