diff options
author | clsung <clsung@FreeBSD.org> | 2006-05-20 16:23:34 +0000 |
---|---|---|
committer | clsung <clsung@FreeBSD.org> | 2006-05-20 16:23:34 +0000 |
commit | 99eb5a1f4faf433d09f0ce528512cffb75b30ecc (patch) | |
tree | d286de59a2f740eddb12c9d3f0c4cfc7c62ea7f0 /chinese | |
parent | 6729cfe86174473c795141654a817379b1c0f876 (diff) | |
download | FreeBSD-ports-99eb5a1f4faf433d09f0ce528512cffb75b30ecc.zip FreeBSD-ports-99eb5a1f4faf433d09f0ce528512cffb75b30ecc.tar.gz |
- 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>
Diffstat (limited to 'chinese')
-rw-r--r-- | chinese/libchewing/Makefile | 1 | ||||
-rw-r--r-- | chinese/libchewing/files/patch-src-char.c | 11 | ||||
-rw-r--r-- | chinese/libchewing/files/patch-src-dict.c | 11 |
3 files changed, 23 insertions, 0 deletions
diff --git a/chinese/libchewing/Makefile b/chinese/libchewing/Makefile index 6c08817..e2bfa54 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 0000000..353fd37 --- /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 0000000..5b24125 --- /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 ) |