1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-06 17:53:13 +02:00

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

(cherry picked from commit dac076c242)
This commit is contained in:
Sébastien Helleu
2014-08-16 09:07:10 +02:00
parent 06414d1410
commit 570b74569d
+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;
}