summaryrefslogtreecommitdiff
path: root/chinese/libchewing
diff options
context:
space:
mode:
authorCheng-Lung Sung <clsung@FreeBSD.org>2006-05-20 16:23:34 +0000
committerCheng-Lung Sung <clsung@FreeBSD.org>2006-05-20 16:23:34 +0000
commitd5a4216ceaf4d5c274da74e6f2ae75bd4e177b4d (patch)
treec707726f80a956d6c1764259974cf3ce92a81ad6 /chinese/libchewing
parentAdd port: www/xpi-forecastfox (diff)
- since isspace(0xa0) return true. When using sscanf(...,"%s",...),
it will treat some UTF8 words containing 0xa0 as spaces. Thus those words will be skipped. - added two patch to avoid that problem. - bump PORTREVISION Submitted by: Rong-En Fan <rafan_AT_infor dot org>
Notes
Notes: svn path=/head/; revision=162881
Diffstat (limited to 'chinese/libchewing')
-rw-r--r--chinese/libchewing/Makefile1
-rw-r--r--chinese/libchewing/files/patch-src-char.c11
-rw-r--r--chinese/libchewing/files/patch-src-dict.c11
3 files changed, 23 insertions, 0 deletions
diff --git a/chinese/libchewing/Makefile b/chinese/libchewing/Makefile
index 6c0881715cd2..e2bfa54d5b76 100644
--- a/chinese/libchewing/Makefile
+++ b/chinese/libchewing/Makefile
@@ -7,6 +7,7 @@
PORTNAME= libchewing
PORTVERSION= 0.3.0
+PORTREVISION= 1
CATEGORIES= chinese textproc
MASTER_SITES= http://chewing.csie.net/download/libchewing/
diff --git a/chinese/libchewing/files/patch-src-char.c b/chinese/libchewing/files/patch-src-char.c
new file mode 100644
index 000000000000..353fd37bd874
--- /dev/null
+++ b/chinese/libchewing/files/patch-src-char.c
@@ -0,0 +1,11 @@
+--- src/char.c.orig Mon May 15 14:49:43 2006
++++ src/char.c Sun May 21 00:14:41 2006
+@@ -126,7 +126,7 @@
+
+ fgettab( buf, 1000, dictfile );
+ /* only read 6 bytes to wrd_ptr->word avoid buffer overflow */
+- sscanf( buf, "%hu %6s", &sh, wrd_ptr->word );
++ sscanf( buf, "%hu %6[^ ]", &sh, wrd_ptr->word );
+ assert( wrd_ptr->word != NULL );
+ }
+
diff --git a/chinese/libchewing/files/patch-src-dict.c b/chinese/libchewing/files/patch-src-dict.c
new file mode 100644
index 000000000000..5b24125c8016
--- /dev/null
+++ b/chinese/libchewing/files/patch-src-dict.c
@@ -0,0 +1,11 @@
+--- src/dict.c.orig Mon May 15 14:49:43 2006
++++ src/dict.c Sun May 21 00:14:29 2006
+@@ -101,7 +101,7 @@
+ char buf[ 1000 ];
+
+ fgettab( buf, 1000, dictfile );
+- sscanf( buf, "%s %d", phr_ptr->phrase, &( phr_ptr->freq ) );
++ sscanf( buf, "%[^ ] %d", phr_ptr->phrase, &( phr_ptr->freq ) );
+ }
+
+ int GetPhraseFirst( Phrase *phr_ptr, int phone_phr_id )