summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2008-07-08 08:13:22 +0200
committerSebastien Helleu <flashcode@flashtux.org>2008-07-08 08:13:22 +0200
commit4d76b74ab2a3efec559637d4d3bd19ea24fdae73 (patch)
treeeaea67e78e945a4c62627e6d7dcb768182ea51ed /src/core
parent1788d95a0bc14dd06964475176198890490209d4 (diff)
downloadweechat-4d76b74ab2a3efec559637d4d3bd19ea24fdae73.zip
Remove error message when bar is not found for scroll
Diffstat (limited to 'src/core')
-rw-r--r--src/core/wee-command.c70
1 files changed, 32 insertions, 38 deletions
diff --git a/src/core/wee-command.c b/src/core/wee-command.c
index d24094291..9d21fe975 100644
--- a/src/core/wee-command.c
+++ b/src/core/wee-command.c
@@ -435,50 +435,44 @@ command_bar (void *data, struct t_gui_buffer *buffer,
return WEECHAT_RC_ERROR;
}
ptr_bar = gui_bar_search (argv[2]);
- if (!ptr_bar)
- {
- gui_chat_printf (NULL,
- _("%sError: unknown bar \"%s\""),
- gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
- argv[2]);
- return WEECHAT_RC_ERROR;
- }
- if (strcmp (argv[3], "*") == 0)
- ptr_buffer = buffer;
- else
+ if (ptr_bar)
{
- pos_point = strchr (argv[3], '.');
- if (pos_point)
+ if (strcmp (argv[3], "*") == 0)
+ ptr_buffer = buffer;
+ else
{
- category = string_strndup (argv[3], pos_point - argv[3]);
- ptr_buffer_name = pos_point + 1;
+ pos_point = strchr (argv[3], '.');
+ if (pos_point)
+ {
+ category = string_strndup (argv[3], pos_point - argv[3]);
+ ptr_buffer_name = pos_point + 1;
+ }
+ else
+ {
+ category = NULL;
+ ptr_buffer_name = argv[3];
+ }
+ ptr_buffer = gui_buffer_search_by_category_name (category,
+ ptr_buffer_name);
+ if (category)
+ free (category);
}
- else
+ if (!ptr_buffer)
+ {
+ gui_chat_printf (NULL,
+ _("%sError: buffer not found for \"%s\" command"),
+ gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], "bar");
+ return WEECHAT_RC_ERROR;
+ }
+ if (!gui_bar_scroll (ptr_bar, ptr_buffer, argv_eol[4]))
{
- category = NULL;
- ptr_buffer_name = argv[3];
+ gui_chat_printf (NULL,
+ _("%sError: unable to scroll bar \"%s\""),
+ gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
+ argv[2]);
+ return WEECHAT_RC_ERROR;
}
- ptr_buffer = gui_buffer_search_by_category_name (category,
- ptr_buffer_name);
- if (category)
- free (category);
- }
- if (!ptr_buffer)
- {
- gui_chat_printf (NULL,
- _("%sError: buffer not found for \"%s\" command"),
- gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], "bar");
- return WEECHAT_RC_ERROR;
}
- if (!gui_bar_scroll (ptr_bar, ptr_buffer, argv_eol[4]))
- {
- gui_chat_printf (NULL,
- _("%sError: unable to scroll bar \"%s\""),
- gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
- argv[2]);
- return WEECHAT_RC_ERROR;
- }
-
return WEECHAT_RC_OK;
}