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 /src/gui | |
parent | dfbea2850a3b8c53afb2cecc133cb8c2efadd353 (diff) | |
download | weechat-8f3455d0a90169396c279dddaac0f336873e3f14.zip |
Fixed infinite loop when scrolling back and displaying long lines
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/curses/gui-display.c | 26 |
1 files changed, 16 insertions, 10 deletions
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 |