1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-05 01:03:14 +02:00

aspell: display an error if command "/aspell setdict" is called without a dictionary

This commit is contained in:
Sébastien Helleu
2014-08-16 09:07:10 +02:00
parent 2d5f563d89
commit dac076c242
+7 -8
View File
@@ -420,14 +420,13 @@ weechat_aspell_command_cb (void *data, struct t_gui_buffer *buffer,
/* set dictionary for current buffer */
if (weechat_strcasecmp (argv[1], "setdict") == 0)
{
if (argc > 2)
{
dicts = weechat_string_replace (argv_eol[2], " ", "");
weechat_aspell_command_set_dict (buffer,
(dicts) ? dicts : argv[2]);
if (dicts)
free (dicts);
}
if (argc < 3)
return WEECHAT_RC_ERROR;
dicts = weechat_string_replace (argv_eol[2], " ", "");
weechat_aspell_command_set_dict (buffer,
(dicts) ? dicts : argv[2]);
if (dicts)
free (dicts);
return WEECHAT_RC_OK;
}