Compare commits
No commits in common. "5d429290e73e616abc64ac5284ae2860504ea028" and "b4e4556b7ac101b4194bbd6427bad479d63dcfb2" have entirely different histories.
5d429290e7
...
b4e4556b7a
@ -1,113 +0,0 @@
|
|||||||
From f6659579ec8f165db7f931eb05717f9f93ef27ef Mon Sep 17 00:00:00 2001
|
|
||||||
From: Reuben Thomas <rrt@sc3d.org>
|
|
||||||
Date: Mon, 14 Jun 2021 15:22:33 +0100
|
|
||||||
Subject: [PATCH] pwl.c: allow the PWL APIs to be passed -1 as word length
|
|
||||||
|
|
||||||
This is strictly an API/ABI change, but bump only the minor version, as in
|
|
||||||
practice it is simply an extension that makes the enchant_pwl_* APIs work
|
|
||||||
like the enchant_dict_* APIs.
|
|
||||||
---
|
|
||||||
configure.ac | 2 +-
|
|
||||||
src/pwl.c | 22 +++++++++++++++++-----
|
|
||||||
src/pwl.h | 8 ++++----
|
|
||||||
3 files changed, 22 insertions(+), 10 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/configure.ac b/configure.ac
|
|
||||||
index 4877edc..e67163e 100644
|
|
||||||
--- a/configure.ac
|
|
||||||
+++ b/configure.ac
|
|
||||||
@@ -1,4 +1,4 @@
|
|
||||||
-AC_INIT([enchant],[2.2.15])
|
|
||||||
+AC_INIT([enchant],[2.3.0])
|
|
||||||
AC_CONFIG_SRCDIR(src/enchant.h)
|
|
||||||
AC_CONFIG_AUX_DIR([build-aux])
|
|
||||||
AM_INIT_AUTOMAKE([subdir-objects])
|
|
||||||
diff --git a/src/pwl.c b/src/pwl.c
|
|
||||||
index 4f118a1..db645d5 100644
|
|
||||||
--- a/src/pwl.c
|
|
||||||
+++ b/src/pwl.c
|
|
||||||
@@ -313,8 +313,11 @@ static void enchant_pwl_remove_from_trie(EnchantPWL *pwl,
|
|
||||||
}
|
|
||||||
|
|
||||||
void enchant_pwl_add(EnchantPWL *pwl,
|
|
||||||
- const char *const word, size_t len)
|
|
||||||
+ const char *const word, ssize_t len)
|
|
||||||
{
|
|
||||||
+ if (len < 0)
|
|
||||||
+ len = strlen (word);
|
|
||||||
+
|
|
||||||
enchant_pwl_refresh_from_file(pwl);
|
|
||||||
|
|
||||||
enchant_pwl_add_to_trie(pwl, word, len);
|
|
||||||
@@ -342,7 +345,7 @@ void enchant_pwl_add(EnchantPWL *pwl,
|
|
||||||
putc ('\n', f);
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (fwrite (word, sizeof(char), len, f) == len)
|
|
||||||
+ if (fwrite (word, sizeof(char), len, f) == (size_t)len)
|
|
||||||
{
|
|
||||||
putc ('\n', f);
|
|
||||||
}
|
|
||||||
@@ -353,8 +356,11 @@ void enchant_pwl_add(EnchantPWL *pwl,
|
|
||||||
}
|
|
||||||
|
|
||||||
void enchant_pwl_remove(EnchantPWL *pwl,
|
|
||||||
- const char *const word, size_t len)
|
|
||||||
+ const char *const word, ssize_t len)
|
|
||||||
{
|
|
||||||
+ if (len < 0)
|
|
||||||
+ len = strlen (word);
|
|
||||||
+
|
|
||||||
if(enchant_pwl_check(pwl, word, len) == 1)
|
|
||||||
return;
|
|
||||||
|
|
||||||
@@ -525,8 +531,11 @@ static gchar* enchant_utf8_strtitle(const gchar*str, gssize len)
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
-int enchant_pwl_check(EnchantPWL *pwl, const char *const word, size_t len)
|
|
||||||
+int enchant_pwl_check(EnchantPWL *pwl, const char *const word, ssize_t len)
|
|
||||||
{
|
|
||||||
+ if (len < 0)
|
|
||||||
+ len = strlen (word);
|
|
||||||
+
|
|
||||||
enchant_pwl_refresh_from_file(pwl);
|
|
||||||
|
|
||||||
int exists = enchant_pwl_contains(pwl, word, len);
|
|
||||||
@@ -609,8 +618,11 @@ static int best_distance(char** suggs, const char *const word, size_t len)
|
|
||||||
/* gives the best set of suggestions from pwl that are at least as good as the
|
|
||||||
* given suggs (if suggs == NULL just best from pwl) */
|
|
||||||
char** enchant_pwl_suggest(EnchantPWL *pwl, const char *const word,
|
|
||||||
- size_t len, char** suggs, size_t* out_n_suggs)
|
|
||||||
+ ssize_t len, char** suggs, size_t* out_n_suggs)
|
|
||||||
{
|
|
||||||
+ if (len < 0)
|
|
||||||
+ len = strlen (word);
|
|
||||||
+
|
|
||||||
int max_dist = suggs ? best_distance(suggs, word, len) : ENCHANT_PWL_MAX_ERRORS;
|
|
||||||
max_dist = MIN (max_dist, ENCHANT_PWL_MAX_ERRORS);
|
|
||||||
|
|
||||||
diff --git a/src/pwl.h b/src/pwl.h
|
|
||||||
index f713b29..c945e3c 100644
|
|
||||||
--- a/src/pwl.h
|
|
||||||
+++ b/src/pwl.h
|
|
||||||
@@ -42,12 +42,12 @@ typedef struct str_enchant_pwl EnchantPWL;
|
|
||||||
EnchantPWL* enchant_pwl_init(void);
|
|
||||||
EnchantPWL* enchant_pwl_init_with_file(const char * file);
|
|
||||||
|
|
||||||
-void enchant_pwl_add(EnchantPWL * me, const char *const word, size_t len);
|
|
||||||
-void enchant_pwl_remove(EnchantPWL * me, const char *const word, size_t len);
|
|
||||||
-int enchant_pwl_check(EnchantPWL * me,const char *const word, size_t len);
|
|
||||||
+void enchant_pwl_add(EnchantPWL * me, const char *const word, ssize_t len);
|
|
||||||
+void enchant_pwl_remove(EnchantPWL * me, const char *const word, ssize_t len);
|
|
||||||
+int enchant_pwl_check(EnchantPWL * me, const char *const word, ssize_t len);
|
|
||||||
/*gives the best set of suggestions from pwl that are at least as good as the given suggs*/
|
|
||||||
char** enchant_pwl_suggest(EnchantPWL *me, const char *const word,
|
|
||||||
- size_t len, char ** suggs, size_t* out_n_suggs);
|
|
||||||
+ ssize_t len, char ** suggs, size_t* out_n_suggs);
|
|
||||||
void enchant_pwl_free(EnchantPWL* me);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
--
|
|
||||||
2.42.0.windows.2
|
|
||||||
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
Reference: https://bugzilla.redhat.com/show_bug.cgi?id=1574893
|
|
||||||
Conflict: NA
|
|
||||||
|
|
||||||
---
|
|
||||||
configure.ac | 2 +-
|
|
||||||
providers/Makefile.am | 1 +
|
|
||||||
tests/test.pwl.orig | 2 --
|
|
||||||
3 files changed, 2 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/configure.ac b/configure.ac
|
|
||||||
index 4877edc..eda506e 100644
|
|
||||||
--- a/configure.ac
|
|
||||||
+++ b/configure.ac
|
|
||||||
@@ -210,7 +210,7 @@ build_providers=
|
|
||||||
dnl Standard providers
|
|
||||||
ENCHANT_CHECK_PKG_CONFIG_PROVIDER([hunspell], [HUNSPELL])
|
|
||||||
ENCHANT_CHECK_PKG_CONFIG_PROVIDER([nuspell], [NUSPELL], [nuspell >= 4.1.0])
|
|
||||||
-ENCHANT_CHECK_LIB_PROVIDER([aspell], [ASPELL], [get_aspell_dict_info_list])
|
|
||||||
+ENCHANT_CHECK_PKG_CONFIG_PROVIDER([aspell], [ASPELL])
|
|
||||||
ENCHANT_CHECK_LIB_PROVIDER([hspell], [HSPELL], [hspell_get_dictionary_path],, [-lz])
|
|
||||||
ENCHANT_CHECK_PKG_CONFIG_PROVIDER([voikko], [VOIKKO], [libvoikko])
|
|
||||||
dnl FIXME: The test below assumes GCC(-compatible) ObjC++ compiler, but
|
|
||||||
diff --git a/providers/Makefile.am b/providers/Makefile.am
|
|
||||||
index 8571dcc..4ba8a94 100644
|
|
||||||
--- a/providers/Makefile.am
|
|
||||||
+++ b/providers/Makefile.am
|
|
||||||
@@ -12,6 +12,7 @@ AM_LDFLAGS = -module -avoid-version -no-undefined $(ENCHANT_LIBS) $(top_builddir
|
|
||||||
if WITH_ASPELL
|
|
||||||
provider_LTLIBRARIES += enchant_aspell.la
|
|
||||||
endif
|
|
||||||
+enchant_aspell_la_LIBADD = $(ASPELL_LIBS)
|
|
||||||
|
|
||||||
if WITH_HSPELL
|
|
||||||
provider_LTLIBRARIES += enchant_hspell.la
|
|
||||||
diff --git a/tests/test.pwl.orig b/tests/test.pwl.orig
|
|
||||||
index c6089a7..e69de29 100644
|
|
||||||
--- a/tests/test.pwl.orig
|
|
||||||
+++ b/tests/test.pwl.orig
|
|
||||||
@@ -1,2 +0,0 @@
|
|
||||||
-hello
|
|
||||||
-tag
|
|
||||||
--
|
|
||||||
2.23.0
|
|
||||||
|
|
||||||
Binary file not shown.
BIN
enchant-2.2.3.tar.gz
Normal file
BIN
enchant-2.2.3.tar.gz
Normal file
Binary file not shown.
@ -1,16 +1,15 @@
|
|||||||
Name: enchant2
|
Name: enchant2
|
||||||
Version: 2.2.15
|
Version: 2.2.3
|
||||||
Release: 3
|
Release: 6
|
||||||
Summary: Generic spell checking library
|
Summary: Generic spell checking library
|
||||||
License: LGPLv2+
|
License: LGPLv2+
|
||||||
URL: https://github.com/AbiWord/enchant
|
URL: https://github.com/AbiWord/enchant
|
||||||
Source0: https://github.com/AbiWord/enchant/releases/download/v%{version}/enchant-%{version}.tar.gz
|
Source0: https://github.com/AbiWord/enchant/releases/download/v%{version}/enchant-%{version}.tar.gz
|
||||||
Patch6000: backport-enchant_aspell.patch
|
|
||||||
Patch6001: 0001-pwl.c-allow-the-PWL-APIs-to-be-passed-1-as-word-leng.patch
|
|
||||||
|
|
||||||
BuildRequires: automake autoconf libtool gcc-c++ glib2-devel aspell-devel hunspell-devel libvoikko-devel
|
BuildRequires: automake autoconf libtool gcc-c++ glib2-devel aspell-devel hunspell-devel libvoikko-devel
|
||||||
|
|
||||||
Provides: bundled(gnulib)
|
Provides: bundled(gnulib) %{name}-aspell = %{version}-%{release} %{name}-voikko = %{version}-%{release}
|
||||||
|
Obsoletes: %{name}-aspell < %{version}-%{release} %{name}-voikko < %{version}-%{release}
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Enchant aims to provide a simple but comprehensive abstraction for dealing
|
Enchant aims to provide a simple but comprehensive abstraction for dealing
|
||||||
@ -27,24 +26,6 @@ Requires: %{name} = %{version}-%{release} glib2-devel
|
|||||||
This package contains some libraries and header files for
|
This package contains some libraries and header files for
|
||||||
development of %{name}.
|
development of %{name}.
|
||||||
|
|
||||||
%package aspell
|
|
||||||
Summary: Aspell is integrated for libenchant
|
|
||||||
Requires: %{name} = %{version}-%{release}
|
|
||||||
Provides: %{name}-aspell = %{version}-%{release}
|
|
||||||
Obsoletes: %{name}-aspell < %{version}-%{release}
|
|
||||||
|
|
||||||
%description aspell
|
|
||||||
Applications need libraries integrated by using libenchant with aspell.
|
|
||||||
|
|
||||||
%package voikko
|
|
||||||
Summary: voikko is integrated for libenchant
|
|
||||||
Requires: %{name} = %{version}-%{release}
|
|
||||||
Provides: %{name}-voikko = %{version}-%{release}
|
|
||||||
Obsoletes: %{name}-voikko < %{version}-%{release}
|
|
||||||
|
|
||||||
%description voikko
|
|
||||||
Applications need libraries integrated by using libenchant with voikko.
|
|
||||||
|
|
||||||
%package help
|
%package help
|
||||||
Summary: Help package for %{name}
|
Summary: Help package for %{name}
|
||||||
Requires: %{name} = %{version}-%{release}
|
Requires: %{name} = %{version}-%{release}
|
||||||
@ -77,15 +58,9 @@ sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g;
|
|||||||
%license COPYING.LIB
|
%license COPYING.LIB
|
||||||
%{_bindir}/{enchant-2,enchant-lsmod-2}
|
%{_bindir}/{enchant-2,enchant-lsmod-2}
|
||||||
%{_libdir}/libenchant-2.so.*
|
%{_libdir}/libenchant-2.so.*
|
||||||
%{_libdir}/enchant-2/enchant_hunspell.so
|
%{_libdir}/enchant-2/*
|
||||||
%{_datadir}/enchant-2
|
%{_datadir}/enchant-2
|
||||||
|
|
||||||
%files aspell
|
|
||||||
%{_libdir}/enchant-2/enchant_aspell.so*
|
|
||||||
|
|
||||||
%files voikko
|
|
||||||
%{_libdir}/enchant-2/enchant_voikko.so*
|
|
||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
%{_libdir}/libenchant-2.so
|
%{_libdir}/libenchant-2.so
|
||||||
%{_libdir}/pkgconfig/enchant-2.pc
|
%{_libdir}/pkgconfig/enchant-2.pc
|
||||||
@ -95,23 +70,5 @@ sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g;
|
|||||||
%{_mandir}/man1/*
|
%{_mandir}/man1/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Tue Oct 24 2023 liubo <liubo1@xfusion.com> - 2.2.15-3
|
|
||||||
- pwl.c: allow the PWL APIs to be passed -1 as word length
|
|
||||||
|
|
||||||
* Thu Apr 29 2021 zhaoyuxing <zhaoyuxing2@huawei.com> - 2.2.15-2
|
|
||||||
- Type:bugfix
|
|
||||||
- CVE:NA
|
|
||||||
- SUG:NA
|
|
||||||
- DESC: split aspell and voikko subpackage & backport patch that enchant2 use hunspell
|
|
||||||
|
|
||||||
* Mon Feb 1 2021 chengguipeng1 <chengguipeng1@huawei.com> - 2.2.15-1
|
|
||||||
- DESC: update to 2.2.15
|
|
||||||
|
|
||||||
* Sun Jan 19 2020 wutao <wutao61@huawei.com> - 2.2.3-7
|
|
||||||
- Type:bugfix
|
|
||||||
- ID:NA
|
|
||||||
- SUG:NA
|
|
||||||
- DESC: modify spec
|
|
||||||
|
|
||||||
* Mon Nov 04 2019 huzhiyu <huzhiyu1@huawei.com> - 2.2.3-6
|
* Mon Nov 04 2019 huzhiyu <huzhiyu1@huawei.com> - 2.2.3-6
|
||||||
- Package init
|
- Package init
|
||||||
|
|||||||
@ -1,4 +0,0 @@
|
|||||||
version_control: github
|
|
||||||
src_repo: AbiWord/enchant
|
|
||||||
tag_prefix: ^v
|
|
||||||
seperator: .
|
|
||||||
Loading…
x
Reference in New Issue
Block a user