# HG changeset patch # User Mikael Berthe # Date 1170743840 -3600 # Node ID 0e27177882c7b3c4944e31b8be59c9fcf06079b3 # Parent 5be2408a65346ccdfca5b41e9e1fda8438cfbbaf Small fix for the max_history_blocks option diff -r 5be2408a6534 -r 0e27177882c7 mcabber/src/screen.c --- a/mcabber/src/screen.c Tue Feb 06 00:21:42 2007 +0100 +++ b/mcabber/src/screen.c Tue Feb 06 07:37:20 2007 +0100 @@ -660,6 +660,7 @@ char *text_locale; int dont_show = FALSE; int special; + guint num_history_blocks; bool setmsgflg = FALSE; // Look for the window entry. @@ -689,10 +690,16 @@ if (win_entry->cleared) win_entry->top = g_list_last(win_entry->hbuf); + // Make sure we do not free the buffer while it's locked or when + // top is set. + if (win_entry->lock || win_entry->top) + num_history_blocks = 0U; + else + num_history_blocks = get_max_history_blocks(); + text_locale = from_utf8(text); hbuf_add_line(&win_entry->hbuf, text_locale, timestamp, prefix_flags, - maxX - Roster_Width - PREFIX_WIDTH, - get_max_history_blocks()); + maxX - Roster_Width - PREFIX_WIDTH, num_history_blocks); g_free(text_locale); if (win_entry->cleared) {