rpms/enchant/devel enchant-1.5.0-abi12173.leaks.patch, NONE, 1.1 enchant-1.5.0-abi12174.fixbadmatch.patch, NONE, 1.1 enchant.spec, 1.24, 1.25
Caolan McNamara
caolanm at fedoraproject.org
Thu Jul 2 12:49:10 UTC 2009
- Previous message (by thread): rpms/gegl/devel .cvsignore, 1.8, 1.9 gegl.spec, 1.14, 1.15 sources, 1.8, 1.9 gegl-babl_api_change.patch, 1.1, NONE
- Next message (by thread): rpms/ibus-sayura/F-11 dual_matra_problem.patch, 1.2, 1.3 ibus-sayura.spec, 1.3, 1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: caolanm
Update of /cvs/pkgs/rpms/enchant/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv26302
Modified Files:
enchant.spec
Added Files:
enchant-1.5.0-abi12173.leaks.patch
enchant-1.5.0-abi12174.fixbadmatch.patch
Log Message:
Resolves: rhbz#508781 improve enchant quality, leaks, and edge-case language dict selection
enchant-1.5.0-abi12173.leaks.patch:
--- NEW FILE enchant-1.5.0-abi12173.leaks.patch ---
diff -ru enchant-1.4.2.orig/src/enchant.c enchant-1.4.2/src/enchant.c
--- enchant-1.4.2.orig/src/enchant.c 2009-06-29 17:47:11.000000000 +0100
+++ enchant-1.4.2/src/enchant.c 2009-06-29 20:46:17.000000000 +0100
@@ -1543,11 +1544,13 @@
EnchantDict *dict;
EnchantProvider *owner;
EnchantSession *session;
+ EnchantDictPrivateData *enchant_dict_private_data;
g_return_if_fail (data);
dict = (EnchantDict *) data;
- session = ((EnchantDictPrivateData*)dict->enchant_private_data)->session;
+ enchant_dict_private_data = (EnchantDictPrivateData*)dict->enchant_private_data;
+ session = enchant_dict_private_data->session;
owner = session->provider;
if (owner && owner->dispose_dict)
@@ -1555,6 +1558,8 @@
else if(session->is_pwl)
g_free (dict);
+ g_free(enchant_dict_private_data);
+
enchant_session_destroy (session);
}
diff -ru enchant-1.4.2.orig/tests/enchant-ispell.c enchant-1.4.2/tests/enchant-ispell.c
--- enchant-1.4.2.orig/tests/enchant-ispell.c 2009-06-29 17:47:11.000000000 +0100
+++ enchant-1.4.2/tests/enchant-ispell.c 2009-06-29 20:45:29.000000000 +0100
@@ -431,6 +431,8 @@
do_mode_a (out, dict, word, pos, lineCount);
else if (mode == MODE_L)
do_mode_l (out, dict, word, lineCount);
+
+ g_string_free(word, TRUE);
}
if (token_ptr)
g_slist_free (token_ptr);
@@ -446,8 +448,6 @@
enchant_broker_free_dict (broker, dict);
enchant_broker_free (broker);
- if (word)
- g_string_free (word, TRUE);
g_string_free (str, TRUE);
return 0;
enchant-1.5.0-abi12174.fixbadmatch.patch:
--- NEW FILE enchant-1.5.0-abi12174.fixbadmatch.patch ---
diff -ru enchant-1.4.2.orig/src/myspell/myspell_checker.cpp enchant-1.4.2/src/myspell/myspell_checker.cpp
--- enchant-1.4.2.orig/src/myspell/myspell_checker.cpp 2009-06-29 17:04:41.000000000 +0100
+++ enchant-1.4.2/src/myspell/myspell_checker.cpp 2009-06-29 17:25:40.000000000 +0100
@@ -341,6 +341,27 @@
return g_file_test(aff.c_str(), G_FILE_TEST_EXISTS) != 0;
}
+static bool is_plausible_dict_for_tag(const char *dir_entry, const char *tag)
+{
+ const char *dic_suffix = ".dic";
+ size_t dic_suffix_len = strlen(dic_suffix);
+ size_t dir_entry_len = strlen(dir_entry);
+ size_t tag_len = strlen(tag);
+
+ if (dir_entry_len - dic_suffix_len < tag_len)
+ return false;
+ if (strcmp(dir_entry+dir_entry_len-dic_suffix_len, dic_suffix) != 0)
+ return false;
+ if (strncmp (dir_entry, tag, tag_len) != 0)
+ return false;
+ //e.g. requested dict for "fi",
+ //reject "fil_PH.dic"
+ //allow "fi-FOO.dic", "fi_FOO.dic", "fi.dic", etc.
+ if (!ispunct(dir_entry[tag_len]))
+ return false;
+ return true;
+}
+
static char *
myspell_request_dictionary (EnchantBroker * broker, const char * tag)
{
@@ -364,14 +385,13 @@
if (dir) {
const char *dir_entry;
while ((dir_entry = g_dir_read_name (dir)) != NULL) {
- if (strncmp (dir_entry, tag, strlen(tag)) == 0 &&
- strstr (dir_entry, ".dic") != NULL) {
+ if (is_plausible_dict_for_tag(dir_entry, tag)) {
char *dict = g_build_filename (dirs[i].c_str(),
dir_entry, NULL);
- if(s_hasCorrespondingAffFile(dict)){
- g_dir_close (dir);
- return dict;
- }
+ if(s_hasCorrespondingAffFile(dict)){
+ g_dir_close (dir);
+ return dict;
+ }
}
}
Index: enchant.spec
===================================================================
RCS file: /cvs/pkgs/rpms/enchant/devel/enchant.spec,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -p -r1.24 -r1.25
--- enchant.spec 22 Jun 2009 10:59:53 -0000 1.24
+++ enchant.spec 2 Jul 2009 12:49:10 -0000 1.25
@@ -1,7 +1,7 @@
Summary: An Enchanting Spell Checking Library
Name: enchant
Version: 1.5.0
-Release: 1%{?dist}
+Release: 2%{?dist}
Epoch: 1
Group: System Environment/Libraries
License: LGPLv2+
@@ -16,6 +16,10 @@ BuildRoot: %{_tmppath}/%{name}-%{version
#http://bugzilla.abisource.com/show_bug.cgi?id=12160
Patch0: enchant-1.5.0-abi12160.searchdirs.patch
+#http://bugzilla.abisource.com/show_bug.cgi?id=12173
+Patch1: enchant-1.5.0-abi12173.leaks.patch
+#http://bugzilla.abisource.com/show_bug.cgi?id=12174
+Patch2: enchant-1.5.0-abi12174.fixbadmatch.patch
%description
A library that wraps other spell checking backends.
@@ -49,6 +53,8 @@ Libraries, headers, and support files ne
%prep
%setup -q
%patch0 -p1 -b .searchdirs
+%patch1 -p1 -b .leaks
+%patch2 -p1 -b .fixbadmatch
%build
%configure --enable-myspell --with-myspell-dir=/usr/share/myspell --disable-static --disable-ispell --disable-hspell --disable-zemberek
@@ -90,6 +96,10 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/enchant
rm -r $RPM_BUILD_ROOT
%changelog
+* Thu Jul 02 2009 Caolán McNamara <caolanm at redhat.com> 1:1.5.0-2
+- Resolves: rhbz#508781 improve enchant quality, leaks, and edge-case language
+ dict selection
+
* Mon Jun 22 2009 Caolán McNamara <caolanm at redhat.com> 1:1.5.0-1
- latest version
- Previous message (by thread): rpms/gegl/devel .cvsignore, 1.8, 1.9 gegl.spec, 1.14, 1.15 sources, 1.8, 1.9 gegl-babl_api_change.patch, 1.1, NONE
- Next message (by thread): rpms/ibus-sayura/F-11 dual_matra_problem.patch, 1.2, 1.3 ibus-sayura.spec, 1.3, 1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list