Re: albright - r22318 - in enchant/trunk: src unittests/dictionary

From: Eric Albright <eric_albright_at_sil.org>
Date: Tue Nov 20 2007 - 14:07:35 CET

Thanks,

I fixed them with r22319.

Eric

Dominic Lachowicz wrote:
> Hi Eric,
>
> You've just introduced two memory leaks.
>
> Dom
>
> On Nov 20, 2007 3:22 AM, <cvs@abisource.com> wrote:
>
>> Author: albright
>> Date: 2007-11-20 09:22:02 +0100 (Tue, 20 Nov 2007)
>> New Revision: 22318
>>
>> Modified:
>> enchant/trunk/src/enchant.c
>> enchant/trunk/unittests/dictionary/enchant_dict_suggest_tests.cpp
>> Log:
>> Unicode normalization for comparing suggestion lists
>>
>> Modified: enchant/trunk/src/enchant.c
>> ===================================================================
>> --- enchant/trunk/src/enchant.c 2007-11-20 08:06:55 UTC (rev 22317)
>> +++ enchant/trunk/src/enchant.c 2007-11-20 08:22:02 UTC (rev 22318)
>> @@ -580,9 +580,16 @@
>> copy = 0;
>> else
>> {
>> + char * normalized_new_sugg;
>> +
>> + normalized_new_sugg = g_utf8_normalize (new_suggs[i], sugg_len, G_NORMALIZE_NFD);
>> +
>> for(j = 0; j < n_suggs; j++)
>> {
>> - if(strcmp(suggs[j],new_suggs[i])==0)
>> + char* normalized_sugg;
>> + normalized_sugg = g_utf8_normalize (suggs[j], -1, G_NORMALIZE_NFD);
>> +
>> + if(strcmp(normalized_sugg,normalized_new_sugg)==0)
>> {
>> copy = 0; /*duplicate*/
>> break;
>>
>> Modified: enchant/trunk/unittests/dictionary/enchant_dict_suggest_tests.cpp
>> ===================================================================
>> --- enchant/trunk/unittests/dictionary/enchant_dict_suggest_tests.cpp 2007-11-20 08:06:55 UTC (rev 22317)
>> +++ enchant/trunk/unittests/dictionary/enchant_dict_suggest_tests.cpp 2007-11-20 08:22:02 UTC (rev 22318)
>> @@ -444,6 +444,8 @@
>>
>> ExternalAddWordToDictionary(Convert(L"fiance\x301")); // NFD u0301 = Combining acute accent
>>
>> + ReloadTestDictionary();
>> +
>> size_t cSuggestions;
>> _suggestions = enchant_dict_suggest(_dict, "fiance", -1, &cSuggestions);
>> CHECK(_suggestions);
>>
>> -----------------------------------------------
>> To unsubscribe from this list, send a message to
>> abisource-cvs-commit-request@abisource.com with the word
>> unsubscribe in the message body.
>>
>>
>
>
>
>
Received on Tue Nov 20 14:09:09 2007

This archive was generated by hypermail 2.1.8 : Tue Nov 20 2007 - 14:09:09 CET