This is an automated email from the git hooks/post-receive script.

rene pushed a commit to branch master
in repository hunspell.

commit 406f94a85d9d1285b6ddc76b113d055d5b8de213
Author: Rene Engelhard <[email protected]>
Date:   Fri Oct 17 18:58:38 2014 +0000

    Imported Debian patch 1.3.3-3
---
 debian/changelog                               | 12 ++++++
 debian/patches/bug185.diff                     | 55 ++++++++++++++++++++++++++
 debian/patches/dont-translate-init-string.diff | 29 ++++++++++++++
 debian/patches/series                          |  2 +
 debian/rules                                   |  2 +-
 5 files changed, 99 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 1023a89..47d13df 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+hunspell (1.3.3-3) unstable; urgency=medium
+
+  * debian/patches/bug185.diff: backport patch from upstream bug 185
+    to fix UTF-8 spellchecking (e.g. in emacs) (closes: #762802)
+  * debian/patches/dont-translate-init-string.diff: as name says
+    (closes: #690318)
+  * make config.status in rules depend on configure.ac instead of
+    configure to fix second (re)build; configure is generated by
+    dh_autoreconf anyways
+
+ -- Rene Engelhard <[email protected]>  Fri, 17 Oct 2014 18:58:38 +0000
+
 hunspell (1.3.3-2) unstable; urgency=low
 
   * use dh-autoreconf (closes: #753628)
diff --git a/debian/patches/bug185.diff b/debian/patches/bug185.diff
new file mode 100644
index 0000000..4a2bff8
--- /dev/null
+++ b/debian/patches/bug185.diff
@@ -0,0 +1,55 @@
+--- a/src/tools/hunspell.cxx   2014/09/26 16:24:46     1.60
++++ b/src/tools/hunspell.cxx   2014/10/16 12:59:44     1.61
+@@ -850,13 +850,22 @@
+                       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++) {
+@@ -885,13 +894,23 @@
+                       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++) {
diff --git a/debian/patches/dont-translate-init-string.diff 
b/debian/patches/dont-translate-init-string.diff
new file mode 100644
index 0000000..43f4b49
--- /dev/null
+++ b/debian/patches/dont-translate-init-string.diff
@@ -0,0 +1,29 @@
+--- a/src/tools/hunspell.cxx   2014/10/16 12:59:44     1.61
++++ b/src/tools/hunspell.cxx   2014/10/16 13:28:33     1.62
+@@ -1796,8 +1796,6 @@
+                       exit(0);
+               } else if ((strcmp(argv[i],"-a")==0)) {
+                       filter_mode = PIPE;
+-                      fprintf(stdout,gettext(HUNSPELL_PIPE_HEADING));
+-                      fflush(stdout);
+               } else if ((strcmp(argv[i],"-m")==0)) {
+             /*
+              if -a was used, don't override, i.e. keep ispell compatability
+@@ -2002,6 +2000,17 @@
+           }
+         }
+ 
++      /* 
++         If in pipe mode, output pipe mode version string only when
++         hunspell has properly been started. 
++         Emacs and may be others relies in the English version format. 
++         Do not gettextize. 
++      */
++      if (filter_mode == PIPE) {
++        fprintf(stdout,HUNSPELL_PIPE_HEADING);
++        fflush(stdout);
++      }
++
+       if (arg_files==-1) {
+               pipe_interface(pMS, format, stdin, NULL);
+       } else if (filter_mode != NORMAL) {
diff --git a/debian/patches/series b/debian/patches/series
index d9cfb82..2d1bed4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,4 @@
 aspell_conv
 debian-changes-1.2.4-2
+bug185.diff
+dont-translate-init-string.diff
diff --git a/debian/rules b/debian/rules
index b294931..cf96bf2 100755
--- a/debian/rules
+++ b/debian/rules
@@ -35,7 +35,7 @@ major=2
 #major=`ls src/.libs/lib*.so.* | \
 # awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'`
 
-config.status: configure
+config.status: configure.ac
        dh_testdir
        dh_autoreconf
        CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) 
--build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man 
--infodir=\$${prefix}/share/info \

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-openoffice/hunspell.git

Reply via email to