diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2005-09-14 08:39:14 +0000 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2005-09-14 08:39:14 +0000 |
commit | 8f3455d0a90169396c279dddaac0f336873e3f14 (patch) | |
tree | 0523c5907e8f003dffbe3b8cc7d2f2da4a020130 | |
parent | dfbea2850a3b8c53afb2cecc133cb8c2efadd353 (diff) | |
download | weechat-8f3455d0a90169396c279dddaac0f336873e3f14.zip |
Fixed infinite loop when scrolling back and displaying long lines
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/gui/curses/gui-display.c | 26 | ||||
-rw-r--r-- | weechat/ChangeLog | 3 | ||||
-rw-r--r-- | weechat/src/gui/curses/gui-display.c | 26 |
4 files changed, 36 insertions, 22 deletions
@@ -1,10 +1,11 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2005-09-13 +ChangeLog - 2005-09-14 Version 0.1.5 (under dev!): + * fixed infinite loop when scrolling back and displaying long lines * fixed crash when closing a buffer used by more than one window * added some missing IRC commands * fixed DCC display bug (now decodes string according to charset) diff --git a/src/gui/curses/gui-display.c b/src/gui/curses/gui-display.c index fd3a64ce0..5d75485c7 100644 --- a/src/gui/curses/gui-display.c +++ b/src/gui/curses/gui-display.c @@ -525,7 +525,8 @@ gui_display_word (t_gui_window *window, t_gui_line *line, /* end of word? */ if (!message || (message->prev_message == end_msg) || - ((message == end_msg) && (offset > end_offset))) + ((message == end_msg) && (offset > end_offset)) || + (window->win_chat_cursor_y >= window->win_chat_height)) end_of_word = 1; } @@ -646,16 +647,21 @@ gui_display_line (t_gui_window *window, t_gui_line *line, int count, int simulat word_end_msg, word_end_offset, num_lines, count, &lines_displayed, simulate); - /* move pointer after end of word */ - ptr_message = word_end_msg; - offset = word_end_offset; - gui_message_get_next_char (&ptr_message, &offset); - - /* skip leading spaces? */ - if (skip_spaces) + if (window->win_chat_cursor_y >= window->win_chat_height) + ptr_message = NULL; + else { - while (ptr_message && (ptr_message->message[offset] == ' ')) - gui_message_get_next_char (&ptr_message, &offset); + /* move pointer after end of word */ + ptr_message = word_end_msg; + offset = word_end_offset; + gui_message_get_next_char (&ptr_message, &offset); + + /* skip leading spaces? */ + if (skip_spaces) + { + while (ptr_message && (ptr_message->message[offset] == ' ')) + gui_message_get_next_char (&ptr_message, &offset); + } } } else diff --git a/weechat/ChangeLog b/weechat/ChangeLog index 1a9e7a847..1b75f5023 100644 --- a/weechat/ChangeLog +++ b/weechat/ChangeLog @@ -1,10 +1,11 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2005-09-13 +ChangeLog - 2005-09-14 Version 0.1.5 (under dev!): + * fixed infinite loop when scrolling back and displaying long lines * fixed crash when closing a buffer used by more than one window * added some missing IRC commands * fixed DCC display bug (now decodes string according to charset) diff --git a/weechat/src/gui/curses/gui-display.c b/weechat/src/gui/curses/gui-display.c index fd3a64ce0..5d75485c7 100644 --- a/weechat/src/gui/curses/gui-display.c +++ b/weechat/src/gui/curses/gui-display.c @@ -525,7 +525,8 @@ gui_display_word (t_gui_window *window, t_gui_line *line, /* end of word? */ if (!message || (message->prev_message == end_msg) || - ((message == end_msg) && (offset > end_offset))) + ((message == end_msg) && (offset > end_offset)) || + (window->win_chat_cursor_y >= window->win_chat_height)) end_of_word = 1; } @@ -646,16 +647,21 @@ gui_display_line (t_gui_window *window, t_gui_line *line, int count, int simulat word_end_msg, word_end_offset, num_lines, count, &lines_displayed, simulate); - /* move pointer after end of word */ - ptr_message = word_end_msg; - offset = word_end_offset; - gui_message_get_next_char (&ptr_message, &offset); - - /* skip leading spaces? */ - if (skip_spaces) + if (window->win_chat_cursor_y >= window->win_chat_height) + ptr_message = NULL; + else { - while (ptr_message && (ptr_message->message[offset] == ' ')) - gui_message_get_next_char (&ptr_message, &offset); + /* move pointer after end of word */ + ptr_message = word_end_msg; + offset = word_end_offset; + gui_message_get_next_char (&ptr_message, &offset); + + /* skip leading spaces? */ + if (skip_spaces) + { + while (ptr_message && (ptr_message->message[offset] == ' ')) + gui_message_get_next_char (&ptr_message, &offset); + } } } else |