Hello community, here is the log from the commit of package hunspell for openSUSE:Factory checked in at 2014-08-03 15:36:27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/hunspell (Old) and /work/SRC/openSUSE:Factory/.hunspell.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "hunspell" Changes: -------- --- /work/SRC/openSUSE:Factory/hunspell/hunspell.changes 2014-06-25 15:24:36.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.hunspell.new/hunspell.changes 2014-08-03 15:36:30.000000000 +0200 @@ -1,0 +2,7 @@ +Fri Aug 1 06:16:05 UTC 2014 - [email protected] + +- make hunspell work with emacs and utf-8 [bnc#883505] +- added patches: + * hunspell-emacs-utf8.patch + +------------------------------------------------------------------- New: ---- hunspell-emacs-utf8.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ hunspell.spec ++++++ --- /var/tmp/diff_new_pack.jeDJ0L/_old 2014-08-03 15:36:31.000000000 +0200 +++ /var/tmp/diff_new_pack.jeDJ0L/_new 2014-08-03 15:36:31.000000000 +0200 @@ -26,6 +26,7 @@ Url: http://hunspell.sourceforge.net/ Source0: http://downloads.sourceforge.net/project/%{name}/Hunspell/%{version}/%{name}-%{version}.tar.gz Source1: baselibs.conf +Patch0: hunspell-emacs-utf8.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: gcc-c++ @@ -65,6 +66,7 @@ %prep %setup -q +%patch0 %build autoreconf -vi ++++++ hunspell-emacs-utf8.patch ++++++ http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7781#31 --- src/tools/hunspell.cxx~0 2011-01-21 19:01:29.000000000 +0200 +++ src/tools/hunspell.cxx 2013-02-07 10:11:54.443610900 +0200 @@ -710,13 +748,22 @@ if (pos >= 0) { fflush(stdout); } else { char ** wlst = NULL; - int ns = pMS[d]->suggest(&wlst, token); + int byte_offset = parser->get_tokenpos() + pos; + int char_offset = 0; + if (strcmp(io_enc, "UTF-8") == 0) { + for (int i = 0; i < byte_offset; i++) { + if ((buf[i] & 0xc0) != 0x80) + char_offset++; + } + } else { + char_offset = byte_offset; + } + int ns = pMS[d]->suggest(&wlst, chenc(token, io_enc, dic_enc[d])); if (ns == 0) { - fprintf(stdout,"# %s %d", token, - parser->get_tokenpos() + pos); + fprintf(stdout,"# %s %d", token, char_offset); } else { fprintf(stdout,"& %s %d %d: ", token, ns, - parser->get_tokenpos() + pos); + char_offset); fprintf(stdout,"%s", chenc(wlst[0], dic_enc[d], io_enc)); } for (int j = 1; j < ns; j++) { @@ -745,13 +792,23 @@ if (pos >= 0) { if (root) free(root); } else { char ** wlst = NULL; + int byte_offset = parser->get_tokenpos() + pos; + int char_offset = 0; + if (strcmp(io_enc, "UTF-8") == 0) { + for (int i = 0; i < byte_offset; i++) { + if ((buf[i] & 0xc0) != 0x80) + char_offset++; + } + } else { + char_offset = byte_offset; + } int ns = pMS[d]->suggest(&wlst, chenc(token, io_enc, dic_enc[d])); if (ns == 0) { fprintf(stdout,"# %s %d", chenc(token, io_enc, ui_enc), - parser->get_tokenpos() + pos); + char_offset); } else { fprintf(stdout,"& %s %d %d: ", chenc(token, io_enc, ui_enc), ns, - parser->get_tokenpos() + pos); + char_offset); fprintf(stdout,"%s", chenc(wlst[0], dic_enc[d], ui_enc)); } for (int j = 1; j < ns; j++) { -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
