summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2011-01-20 09:37:20 +0100
committerSebastien Helleu <flashcode@flashtux.org>2011-01-20 09:37:20 +0100
commit1ca2261e95b3f9b9dee59df5ee8fad5e8d493873 (patch)
tree61697dab2951f1ae35aead251f2e48f0abd55cdc
parent68ee325e65615fa781ae8a25df8075201a961162 (diff)
downloadweechat-1ca2261e95b3f9b9dee59df5ee8fad5e8d493873.zip
Fix bug when closing color buffer with command /buffer close N
-rw-r--r--src/core/wee-command.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/wee-command.c b/src/core/wee-command.c
index d6ab14857..a7d84117b 100644
--- a/src/core/wee-command.c
+++ b/src/core/wee-command.c
@@ -474,7 +474,7 @@ command_buffer_display_localvar (void *data,
COMMAND_CALLBACK(buffer)
{
- struct t_gui_buffer *ptr_buffer;
+ struct t_gui_buffer *ptr_buffer, *weechat_buffer;
long number, number1, number2;
char *error, *value, *pos, *str_number1, *pos_number2;
int i, target_buffer;
@@ -638,9 +638,10 @@ COMMAND_CALLBACK(buffer)
/* close buffer */
if (string_strcasecmp (argv[1], "close") == 0)
{
+ weechat_buffer = gui_buffer_search_main();
if (argc < 3)
{
- if (buffer == gui_buffer_search_main ())
+ if (buffer == weechat_buffer)
{
gui_chat_printf (NULL,
_("%sError: WeeChat main buffer can't be "
@@ -701,7 +702,7 @@ COMMAND_CALLBACK(buffer)
{
if (ptr_buffer->number == i)
{
- if (!ptr_buffer->plugin)
+ if (ptr_buffer == weechat_buffer)
{
gui_chat_printf (NULL,
_("%sError: WeeChat main buffer "