Blob Blame History Raw
Index: src/hunspell/affentry.cxx
===================================================================
RCS file: /cvsroot/hunspell/hunspell/src/hunspell/affentry.cxx,v
retrieving revision 1.5
diff -u -r1.5 affentry.cxx
--- src/hunspell/affentry.cxx	27 Apr 2010 15:01:04 -0000	1.5
+++ src/hunspell/affentry.cxx	8 Nov 2010 11:36:57 -0000
@@ -106,7 +106,7 @@
                 pos = NULL;
                 p = nextchar(p);
                 // skip the next character
-                if (!ingroup) for (st++; (opts & aeUTF8) && (*st & 0xc0) == 0x80; st++);
+                if (!ingroup && *st) for (st++; (opts & aeUTF8) && (*st & 0xc0) == 0x80; st++);
                 if (*st == '\0' && p) return 0; // word <= condition
                 break;
             }
Index: src/hunspell/hunspell.cxx
===================================================================
RCS file: /cvsroot/hunspell/hunspell/src/hunspell/hunspell.cxx,v
retrieving revision 1.23
diff -u -r1.23 hunspell.cxx
--- src/hunspell/hunspell.cxx	3 Nov 2010 16:08:04 -0000	1.23
+++ src/hunspell/hunspell.cxx	8 Nov 2010 11:36:58 -0000
@@ -570,6 +570,11 @@
      word = w2;
   } else word = w;
 
+  len = strlen(word);
+
+  if (!len)
+      return NULL;
+
   // word reversing wrapper for complex prefixes
   if (complexprefixes) {
     if (word != w2) {
@@ -607,7 +612,6 @@
   // check with affixes
   if (!he && pAMgr) {
      // try stripping off affixes */
-     len = strlen(word);
      he = pAMgr->affix_check(word, len, 0);
 
      // check compound restriction and onlyupcase
Index: tests/Makefile.am
===================================================================
RCS file: /cvsroot/hunspell/hunspell/tests/Makefile.am,v
retrieving revision 1.4
diff -u -r1.4 Makefile.am
--- tests/Makefile.am	7 Oct 2010 21:05:49 -0000	1.4
+++ tests/Makefile.am	8 Nov 2010 11:36:58 -0000
@@ -101,7 +101,8 @@
 fullstrip.test \
 iconv.test \
 oconv.test \
-korean.test
+korean.test \
+arabic.test
 # infixes.test
 
 distclean-local:
@@ -593,7 +594,10 @@
 korean.dic \
 korean.good \
 korean.wrong \
-korean.test
+korean.test \
+arabic.aff \
+arabic.dic \
+arabic.bad
 # infixes.aff
 # infixes.dic
 # infixes.good
Index: tests/Makefile.in
===================================================================
RCS file: /cvsroot/hunspell/hunspell/tests/Makefile.in,v
retrieving revision 1.8
diff -u -r1.8 Makefile.in
--- tests/Makefile.in	7 Oct 2010 21:05:49 -0000	1.8
+++ tests/Makefile.in	8 Nov 2010 11:36:58 -0000
@@ -283,6 +283,7 @@
 SUBDIRS = suggestiontest
 XFAIL_TESTS = @XFAILED@
 TESTS = \
+arabic.test \
 affixes.test \
 condition.test \
 condition_utf.test \
@@ -379,7 +380,8 @@
 fullstrip.test \
 iconv.test \
 oconv.test \
-korean.test
+korean.test \
+arabic.test
 
 EXTRA_DIST = \
 test.sh \
@@ -867,7 +869,10 @@
 korean.dic \
 korean.good \
 korean.wrong \
-korean.test
+korean.test \
+arabic.aff \
+arabic.dic \
+arabic.bad
 
 all: all-recursive
 
Index: arabic.test
===================================================================
RCS file: arabic.test
diff -N arabic.test
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/arabic.test	8 Nov 2010 11:41:33 -0000
@@ -0,0 +1,4 @@
+#!/bin/sh
+DIR="`dirname $0`"
+NAME="`basename $0 .test`"
+$DIR/test.sh $NAME -i UTF-8
Index: arabic.bad
===================================================================
RCS file: arabic.bad
diff -N arabic.bad
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/arabic.bad	8 Nov 2010 11:41:59 -0000
@@ -0,0 +1 @@
+ـ
Index: arabic.dic
===================================================================
RCS file: arabic.dic
diff -N arabic.dic
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/arabic.dic	8 Nov 2010 11:42:15 -0000
@@ -0,0 +1,2 @@
+1
+ب
Index: arabic.aff
===================================================================
RCS file: arabic.aff
diff -N arabic.aff
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/arabic.aff	8 Nov 2010 11:42:27 -0000
@@ -0,0 +1,6 @@
+SET UTF-8
+TRY أ
+IGNORE ٌٍَُِّْ
+
+PFX	Aa	Y	1
+PFX	Aa	0	0/X0	أ[^ي]