aspell: fix creation of spellers when number of dictionaries is different between two buffers

This commit is contained in:
Sebastien Helleu 2012-11-04 09:59:45 +01:00
parent c848cb42d8
commit ebc4ff82c0
2 changed files with 15 additions and 6 deletions

View File

@ -1,7 +1,7 @@
WeeChat ChangeLog
=================
Sébastien Helleu <flashcode@flashtux.org>
v0.4.0-dev, 2012-11-02
v0.4.0-dev, 2012-11-04
Version 0.4.0 (under dev!)
@ -23,6 +23,8 @@ Version 0.4.0 (under dev!)
hook_connect, move "sock" from hook_connect arguments to callback of
hook_connect (task #11205)
* aspell: add bar item "aspell_dict" (dictionary used on current buffer)
* aspell: fix creation of spellers when number of dictionaries is different
between two buffers
* irc: add command /quiet, fix display of messages 728/729 (quiet list, end of
quiet list) (task #12278)
* irc: add option irc.network.alternate_nick to disable dynamic nick generation

View File

@ -20,7 +20,7 @@
*/
/*
* weechat-aspell.c: aspell plugin for WeeChat: use color to show mispelled
* weechat-aspell.c: aspell plugin for WeeChat: use color to show misspelled
* words in input line
*/
@ -302,21 +302,28 @@ weechat_aspell_spellers_already_ok (const char *dict_list)
if (!dict_list || !weechat_aspell_spellers)
return 0;
rc = 0;
rc = 1;
argv = weechat_string_split (dict_list, ",", 0, 0, &argc);
if (argv)
{
ptr_speller = weechat_aspell_spellers;
for (i = 0; (i < argc) && ptr_speller; i++)
for (i = 0; i < argc; i++)
{
if (strcmp (ptr_speller->lang, argv[i]) == 0)
if (!ptr_speller)
{
rc = 1;
rc = 0;
break;
}
if (strcmp (ptr_speller->lang, argv[i]) != 0)
{
rc = 0;
break;
}
ptr_speller = ptr_speller->next_speller;
}
if (ptr_speller && ptr_speller->next_speller)
rc = 0;
weechat_string_free_split (argv);
}