diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2006-06-24 08:41:01 +0000 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2006-06-24 08:41:01 +0000 |
commit | e5ba6dcb856d5b83c87ca0f5ea249de63f9110f4 (patch) | |
tree | 140b01210be39994c4a0a514f9ae66366f8c6df6 /src/gui | |
parent | 636a6ca08822ad26cb9f94db4d7032789ec558cc (diff) | |
download | weechat-e5ba6dcb856d5b83c87ca0f5ea249de63f9110f4.zip |
Fixed crash when setting look_one_server_buffer to ON (bug #16932)
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/gui-buffer.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c index 0439424a8..d946cdb43 100644 --- a/src/gui/gui-buffer.c +++ b/src/gui/gui-buffer.c @@ -569,7 +569,7 @@ gui_buffer_line_new (t_gui_buffer *buffer) void gui_buffer_merge_servers (t_gui_window *window) { - t_gui_buffer *ptr_buffer_server, *ptr_buffer; + t_gui_buffer *ptr_buffer_server, *ptr_buffer, *new_ptr_buffer; t_irc_server *ptr_server; /* new server buffer is the first server buffer found */ @@ -583,9 +583,9 @@ gui_buffer_merge_servers (t_gui_window *window) /* no server buffer found */ if (!ptr_buffer_server) return; - - for (ptr_buffer = gui_buffers; ptr_buffer; - ptr_buffer = ptr_buffer->next_buffer) + + ptr_buffer = gui_buffers; + while (ptr_buffer) { if ((ptr_buffer != ptr_buffer_server) && (BUFFER_IS_SERVER(ptr_buffer))) @@ -613,12 +613,16 @@ gui_buffer_merge_servers (t_gui_window *window) /* free buffer but not lines, because they're now used by our unique server buffer */ + new_ptr_buffer = ptr_buffer->next_buffer; ptr_buffer->lines = NULL; gui_buffer_free (ptr_buffer, 1); + ptr_buffer = new_ptr_buffer; /* asociate server with new server buffer */ ptr_server->buffer = ptr_buffer_server; } + else + ptr_buffer = ptr_buffer->next_buffer; } ptr_buffer_server->all_servers = 1; |