New upstream version

This commit is contained in:
Marc Maurer 2010-04-01 21:45:09 +00:00
parent 2866f22912
commit fea5c36544
6 changed files with 8 additions and 136 deletions

View File

@ -1 +1 @@
enchant-1.5.0.tar.gz enchant-1.6.0.tar.gz

View File

@ -1,23 +0,0 @@
diff -ru enchant-1.5.0.orig/src/enchant.c enchant-1.5.0/src/enchant.c
--- enchant-1.5.0.orig/src/enchant.c 2009-06-22 11:53:16.000000000 +0100
+++ enchant-1.5.0/src/enchant.c 2009-06-22 11:53:39.000000000 +0100
@@ -232,6 +232,9 @@
if (module_dir)
module_dirs = enchant_slist_append_unique_string (module_dirs, module_dir);
+#if defined(ENCHANT_GLOBAL_MODULE_DIR)
+ module_dirs = enchant_slist_append_unique_string (module_dirs, g_strdup (ENCHANT_GLOBAL_MODULE_DIR));
+#else
/* Dynamically locate library and search for modules relative to it. */
prefix = enchant_get_prefix_dir();
if(prefix)
@@ -240,9 +243,6 @@
g_free(prefix);
module_dirs = enchant_slist_append_unique_string (module_dirs, module_dir);
}
-
-#if defined(ENCHANT_GLOBAL_MODULE_DIR)
- module_dirs = enchant_slist_append_unique_string (module_dirs, g_strdup (ENCHANT_GLOBAL_MODULE_DIR));
#endif
return module_dirs;

View File

@ -1,48 +0,0 @@
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;

View File

@ -1,51 +0,0 @@
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;
+ }
}
}

View File

@ -1,7 +1,7 @@
Summary: An Enchanting Spell Checking Library Summary: An Enchanting Spell Checking Library
Name: enchant Name: enchant
Version: 1.5.0 Version: 1.6.0
Release: 5%{?dist} Release: 1%{?dist}
Epoch: 1 Epoch: 1
Group: System Environment/Libraries Group: System Environment/Libraries
License: LGPLv2+ License: LGPLv2+
@ -14,13 +14,6 @@ BuildRequires: libvoikko-devel
BuildRequires: automake, libtool BuildRequires: automake, libtool
BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRoot: %{_tmppath}/%{name}-%{version}-root
#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 %description
A library that wraps other spell checking backends. A library that wraps other spell checking backends.
@ -52,9 +45,6 @@ Libraries, headers, and support files necessary to compile applications using li
%prep %prep
%setup -q %setup -q
%patch0 -p1 -b .searchdirs
%patch1 -p1 -b .leaks
%patch2 -p1 -b .fixbadmatch
%build %build
%configure --enable-myspell --with-myspell-dir=/usr/share/myspell --disable-static --disable-ispell --disable-hspell --disable-zemberek %configure --enable-myspell --with-myspell-dir=/usr/share/myspell --disable-static --disable-ispell --disable-hspell --disable-zemberek
@ -96,6 +86,10 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/enchant/*.la
rm -r $RPM_BUILD_ROOT rm -r $RPM_BUILD_ROOT
%changelog %changelog
* Thu Apr 01 2010 Marc Maurer <uwog@abisource.com> 1:1.6.0-1
- New upstream version.
- Drop all shipped patches, as they are included upstream.
* Tue Jan 5 2010 Michael Schwendt <mschwendt@fedoraproject.org> 1:1.5.0-5 * Tue Jan 5 2010 Michael Schwendt <mschwendt@fedoraproject.org> 1:1.5.0-5
- Revert 544473: Move libenchant.so back into the -devel package. - Revert 544473: Move libenchant.so back into the -devel package.

View File

@ -1 +1 @@
7dfaed14e142b4a0004b770c9568ed02 enchant-1.5.0.tar.gz de11011aff801dc61042828041fb59c7 enchant-1.6.0.tar.gz