summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-07-15 18:21:44 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-07-15 18:21:44 +0000
commit27fcabbc1965e9d7836f6e196ed2019a215bbe91 (patch)
treebbcc1e7674ac6bf18ef3514cc06b12f52831491f /src
parentfd547c3ebe322316501ef4ba996f5de94550b29f (diff)
downloadirssi-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.c12
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;
}