summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2006-02-26 11:27:43 +0000
committerSebastien Helleu <flashcode@flashtux.org>2006-02-26 11:27:43 +0000
commit5c29def9d961ae45eaf2732ead01ee155a4a2596 (patch)
tree80978ddfaed2b9089290501202718c6777570639
parentc0a1673060a59cca4d003449bde475a0235267e3 (diff)
downloadweechat-5c29def9d961ae45eaf2732ead01ee155a4a2596.zip
Fixed crash when using global history (when older entry is removed)
-rw-r--r--ChangeLog3
-rw-r--r--src/common/history.c4
-rw-r--r--weechat/ChangeLog3
-rw-r--r--weechat/src/common/history.c4
4 files changed, 12 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 03d41570a..10f1cac09 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,11 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
-ChangeLog - 2006-02-22
+ChangeLog - 2006-02-26
Version 0.1.8 (under dev!):
+ * fixed crash when using global history (when older entry is removed)
* added IRC raw data buffer (new key: alt-J + alt-R)
* fixed display bug with /kill command
* added new plugins functions: add_timer_handler, remove_timer_handler,
diff --git a/src/common/history.c b/src/common/history.c
index f7aeae403..db61276f7 100644
--- a/src/common/history.c
+++ b/src/common/history.c
@@ -99,6 +99,8 @@ history_buffer_add (void *buffer, char *string)
&& (((t_gui_buffer *)(buffer))->num_history > cfg_history_max_commands))
{
ptr_history = ((t_gui_buffer *)buffer)->last_history->prev_history;
+ if (((t_gui_buffer *)buffer)->ptr_history == ((t_gui_buffer *)buffer)->last_history)
+ ((t_gui_buffer *)buffer)->ptr_history = ptr_history;
((t_gui_buffer *)buffer)->last_history->prev_history->next_history = NULL;
if (((t_gui_buffer *)buffer)->last_history->text)
free (((t_gui_buffer *)buffer)->last_history->text);
@@ -144,6 +146,8 @@ history_global_add (char *string)
&& (num_history_global > cfg_history_max_commands))
{
ptr_history = history_global_last->prev_history;
+ if (history_global_ptr == history_global_last)
+ history_global_ptr = ptr_history;
history_global_last->prev_history->next_history = NULL;
if (history_global_last->text)
free (history_global_last->text);
diff --git a/weechat/ChangeLog b/weechat/ChangeLog
index 03d41570a..10f1cac09 100644
--- a/weechat/ChangeLog
+++ b/weechat/ChangeLog
@@ -1,10 +1,11 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
-ChangeLog - 2006-02-22
+ChangeLog - 2006-02-26
Version 0.1.8 (under dev!):
+ * fixed crash when using global history (when older entry is removed)
* added IRC raw data buffer (new key: alt-J + alt-R)
* fixed display bug with /kill command
* added new plugins functions: add_timer_handler, remove_timer_handler,
diff --git a/weechat/src/common/history.c b/weechat/src/common/history.c
index f7aeae403..db61276f7 100644
--- a/weechat/src/common/history.c
+++ b/weechat/src/common/history.c
@@ -99,6 +99,8 @@ history_buffer_add (void *buffer, char *string)
&& (((t_gui_buffer *)(buffer))->num_history > cfg_history_max_commands))
{
ptr_history = ((t_gui_buffer *)buffer)->last_history->prev_history;
+ if (((t_gui_buffer *)buffer)->ptr_history == ((t_gui_buffer *)buffer)->last_history)
+ ((t_gui_buffer *)buffer)->ptr_history = ptr_history;
((t_gui_buffer *)buffer)->last_history->prev_history->next_history = NULL;
if (((t_gui_buffer *)buffer)->last_history->text)
free (((t_gui_buffer *)buffer)->last_history->text);
@@ -144,6 +146,8 @@ history_global_add (char *string)
&& (num_history_global > cfg_history_max_commands))
{
ptr_history = history_global_last->prev_history;
+ if (history_global_ptr == history_global_last)
+ history_global_ptr = ptr_history;
history_global_last->prev_history->next_history = NULL;
if (history_global_last->text)
free (history_global_last->text);