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 | |
parent | 636a6ca08822ad26cb9f94db4d7032789ec558cc (diff) | |
download | weechat-e5ba6dcb856d5b83c87ca0f5ea249de63f9110f4.zip |
Fixed crash when setting look_one_server_buffer to ON (bug #16932)
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/gui/gui-buffer.c | 12 | ||||
-rw-r--r-- | weechat/ChangeLog | 3 | ||||
-rw-r--r-- | weechat/src/gui/gui-buffer.c | 12 |
4 files changed, 20 insertions, 10 deletions
@@ -1,9 +1,10 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2006-06-22 +ChangeLog - 2006-06-24 Version 0.2.0 (under dev!): + * fixed crash when setting look_one_server_buffer to ON (bug #16932) * added new functions in plugin/script API: get window info, get buffer info, get buffer content * added polish, russian and czech quickstart guide 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; diff --git a/weechat/ChangeLog b/weechat/ChangeLog index 109c48eda..2d8ea510c 100644 --- a/weechat/ChangeLog +++ b/weechat/ChangeLog @@ -1,9 +1,10 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2006-06-22 +ChangeLog - 2006-06-24 Version 0.2.0 (under dev!): + * fixed crash when setting look_one_server_buffer to ON (bug #16932) * added new functions in plugin/script API: get window info, get buffer info, get buffer content * added polish, russian and czech quickstart guide diff --git a/weechat/src/gui/gui-buffer.c b/weechat/src/gui/gui-buffer.c index 0439424a8..d946cdb43 100644 --- a/weechat/src/gui/gui-buffer.c +++ b/weechat/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; |