Fixed bz#199353 - scim-chewing hangs for commit > 6 characters

epel9
cchance 19 years ago
parent 29e01cd187
commit 37c87a53a8

@ -0,0 +1,51 @@
--- libchewing-0.3.0/src/hanyupinyin.c.1-bz199353 2006-05-15 16:49:43.000000000 +1000
+++ libchewing-0.3.0/src/hanyupinyin.c 2006-09-05 10:47:46.000000000 +1000
@@ -95,13 +95,15 @@
* zuinKeySeq[] has at most 3 letters.
*/
keymap key, *res;
- strcpy( key.pinyin, pinyinKeySeq );
+ strncpy( key.pinyin, pinyinKeySeq, 6 );
DEBUG_CHECKPOINT();
res = bsearch( &key, keytable, N_TOTAL, sizeof(keymap), compkey );
- if ( res != NULL )
+ if ( res != NULL ){
strcpy( zuinKeySeq, res->zuin );
+ return 0;
+ }
else
zuinKeySeq = strdup( "" );
- return 0;
+ return 1;
}
--- libchewing-0.3.0/src/zuin.c.1-bz199353 2006-05-15 16:49:43.000000000 +1000
+++ libchewing-0.3.0/src/zuin.c 2006-09-05 10:47:46.000000000 +1000
@@ -392,14 +392,16 @@
static int PinYinInput( ZuinData *pZuin, int key )
{
int err = 0, status, i;
- char zuinKeySeq[ 5 ], buf[ 2 ];
+ char zuinKeySeq[ 5 ];
DEBUG_CHECKPOINT();
if ( IsPinYinEndKey( pZuin, key ) ) {
err = HanyuPinYinToZuin( pZuin->pinYinData.keySeq, zuinKeySeq );
- if (err)
- return ZUIN_KEY_ERROR;
+ if (err){
+ pZuin->pinYinData.keySeq[0] = '\0';
+ return ZUIN_ABSORB;
+ }
DEBUG_OUT( "zuinKeySeq: %s\n", zuinKeySeq );
for ( i = 0; i < strlen( zuinKeySeq ); i++ ) {
@@ -420,6 +422,7 @@
pZuin->pinYinData.keySeq[ 0 ] = '\0';
return EndKeyProcess( pZuin, key, 1 );
}
+ char buf[2];
buf[ 0 ] = key; buf[ 1 ] = '\0';
strcat( pZuin->pinYinData.keySeq, buf );

@ -1,12 +1,13 @@
Name: libchewing Name: libchewing
Version: 0.3.0 Version: 0.3.0
Release: 2%{?dist} Release: 3%{?dist}
Summary: Intelligent phonetic input method library for Traditional Chinese Summary: Intelligent phonetic input method library for Traditional Chinese
Group: System Environment/Libraries Group: System Environment/Libraries
License: GPL License: GPL
URL: http://chewing.csie.net/ URL: http://chewing.csie.net/
Source: http://chewing.csie.net/download/libchewing/%{name}-%{version}.tar.gz Source: http://chewing.csie.net/download/libchewing/%{name}-%{version}.tar.gz
Patch: libchewing-0.3.0-3.bz199353.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description %description
@ -27,6 +28,7 @@ Headers and other files needed to develop applications using the %name library.
%prep %prep
%setup -q %setup -q
%patch0 -p1 -b .1-bz199353
%build %build
%configure --disable-static %configure --disable-static
@ -60,6 +62,9 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/*.so %{_libdir}/*.so
%changelog %changelog
* Mon Sep 04 2006 Caius Chance <cchance@redhat.com> - 0.3.0-3.fc6
- Fixed bz#199353 - scim-chewing hangs for commit > 6 characters
* Wed Jul 19 2006 Jesse Keating <jkeating@redhat.com> - 0.3.0-2 * Wed Jul 19 2006 Jesse Keating <jkeating@redhat.com> - 0.3.0-2
- fix release - fix release

Loading…
Cancel
Save