diff --git a/anthy-9100e-fix-segfault-vu.patch b/anthy-9100e-fix-segfault-vu.patch new file mode 100644 index 0000000..213610b --- /dev/null +++ b/anthy-9100e-fix-segfault-vu.patch @@ -0,0 +1,56 @@ +diff -pruN anthy-9100e.orig/src-splitter/metaword.c anthy-9100e/src-splitter/metaword.c +--- anthy-9100e.orig/src-splitter/metaword.c 2007-06-18 08:27:38.000000000 +0900 ++++ anthy-9100e/src-splitter/metaword.c 2008-06-27 11:53:55.000000000 +0900 +@@ -17,6 +17,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -158,6 +159,18 @@ get_surrounding_text(struct splitter_con + xs_post->len = post_len; + } + ++static int ++count_vu(xstr *xs) ++{ ++ int i, r = 0; ++ for (i = 0; i < xs->len; i++) { ++ if (xs->str[i] == KK_VU) { ++ r++; ++ } ++ } ++ return r; ++} ++ + /* + * ʣ���Ǥ���wl����n�֤����ʬ����Ф���mw�ˤ��� + */ +@@ -177,8 +190,12 @@ make_compound_nth_metaword(struct splitt + get_surrounding_text(sc, wl, &xs_pre, &xs_post); + + for (i = 0; i <= nth; ++i) { ++ xstr part; + from += len; + len = anthy_compound_get_nth_segment_len(ce, i); ++ part.str = sc->ce[from].c; ++ part.len = len; ++ len -= count_vu(&part); + if (i == 0) { + len += xs_pre.len; + } +@@ -742,7 +759,11 @@ make_metaword_with_depchar(struct splitt + int len = mw ? mw->len : 0; + + /* metaword��ľ���ʸ���μ����Ĵ�٤� */ +- int type = anthy_get_xchar_type(*sc->ce[from + len].c); ++ int type; ++ if (sc->char_count <= from + len) { ++ return; ++ } ++ type = anthy_get_xchar_type(*sc->ce[from + len].c); + if (!(type & XCT_SYMBOL) && + !(type & XCT_PART)) { + return; diff --git a/anthy.spec b/anthy.spec index 997b106..f1e2283 100644 --- a/anthy.spec +++ b/anthy.spec @@ -11,6 +11,7 @@ BuildRequires: xemacs Source0: http://prdownloads.sourceforge.jp/anthy/29142/anthy-%{version}.tar.gz Source1: anthy-init.el +Patch0: anthy-9100e-fix-segfault-vu.patch Summary: Japanese character set input library Group: System Environment/Libraries @@ -50,6 +51,7 @@ character set on XEmacs. %prep %setup -q #-a 2 +%patch0 -p1 -b 0-vu #cp alt-cannadic-%{altcannadicver}/* alt-cannadic/ %build @@ -112,6 +114,9 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/xemacs/site-packages/lisp/site-start.d/anthy-init.el %changelog +* Fri Jun 27 2008 Akira TAGOH - 9100e-3 +- Fix a segfault with some words containing vu. (#452779) + * Tue Feb 12 2008 Akira TAGOH - 9100e-2 - Rebuild for gcc-4.3.