From 489dc390451a2b36e476d1de49e5e61e473f2e96 Mon Sep 17 00:00:00 2001 From: Ying-Chieh Liao Date: Fri, 19 Jul 2002 09:12:40 +0000 Subject: [PATCH] add zh-tw-dictd PR: 40741, 40743 Submitted by: Kuang-che Wu --- chinese/Makefile | 1 + chinese/dictd/Makefile | 18 +++++++ chinese/dictd/files/patch-index.c | 71 +++++++++++++++++++++++++ chinese/dictd/files/patch-libmaa::arg.c | 12 +++++ 4 files changed, 102 insertions(+) create mode 100644 chinese/dictd/Makefile create mode 100644 chinese/dictd/files/patch-index.c create mode 100644 chinese/dictd/files/patch-libmaa::arg.c diff --git a/chinese/Makefile b/chinese/Makefile index 63c7269e7dd0..723bfd36f5f5 100644 --- a/chinese/Makefile +++ b/chinese/Makefile @@ -28,6 +28,7 @@ SUBDIR += cwtex SUBDIR += cxterm SUBDIR += dia + SUBDIR += dictd SUBDIR += dictd-database SUBDIR += emacs20 SUBDIR += enscript diff --git a/chinese/dictd/Makefile b/chinese/dictd/Makefile new file mode 100644 index 000000000000..47100328d7b7 --- /dev/null +++ b/chinese/dictd/Makefile @@ -0,0 +1,18 @@ +# New ports collection makefile for: dictd +# Date created: 19 July 2002 +# Whom: Kuang-che Wu +# +# $FreeBSD$ +# + +CATEGORIES= chinese + +MAINTAINER= kcwu@ck.tp.edu.tw + +MASTERDIR= ${.CURDIR}/../../net/dictd +EXTRA_PATCHES= ${.CURDIR}/files/patch-index.c \ + ${.CURDIR}/files/patch-libmaa::arg.c + +.include "${MASTERDIR}/Makefile" + +PKGNAMEPREFIX:= ${PKGNAMEPREFIX}tw- diff --git a/chinese/dictd/files/patch-index.c b/chinese/dictd/files/patch-index.c new file mode 100644 index 000000000000..a257941d1f46 --- /dev/null +++ b/chinese/dictd/files/patch-index.c @@ -0,0 +1,71 @@ +--- index.c.orig Mon Apr 29 22:43:42 2002 ++++ index.c Fri Jul 19 05:23:01 2002 +@@ -120,6 +120,15 @@ + + /* FIXME. Optimize this inner loop. */ + while (*word && start < end && *start != '\t') { ++ if ((*start & 0x80) && start+1index->end) { + if (!compare( word, pt, database->index->end )) { + if (!previous || altcompare(previous, pt, database->index->end)) { +@@ -643,6 +655,7 @@ + char tmp; + dictWord *datum; + ++ if(*word & 0x80) return count; + #define CHECK \ + if ((pt = dict_index_search(buf, database->index)) \ + && !compare(buf, pt, database->index->end)) { \ +@@ -724,6 +737,11 @@ + if (isspace( *(const unsigned char *)w )) { + *pt++ = ' '; + } else { ++ if((*w & 0x80) && *(w+1)) { ++ *pt++=*w++; ++ *pt++=*w; ++ continue; ++ } + if (!isalnum( *(const unsigned char *)w )) continue; + *pt++ = tolower(*w); + } +@@ -790,6 +808,11 @@ + = binary_search( buf, i->start, i->end ); + } + for (j = '0'; j <= '9'; j++) { ++ buf[0] = j; ++ buf[1] = '\0'; ++ i->optStart[j] = binary_search( buf, i->start, i->end ); ++ } ++ for (j = 0x80; j <= 255; j++) { + buf[0] = j; + buf[1] = '\0'; + i->optStart[j] = binary_search( buf, i->start, i->end ); diff --git a/chinese/dictd/files/patch-libmaa::arg.c b/chinese/dictd/files/patch-libmaa::arg.c new file mode 100644 index 000000000000..14176f4ee9ff --- /dev/null +++ b/chinese/dictd/files/patch-libmaa::arg.c @@ -0,0 +1,12 @@ +--- libmaa/arg.c.orig Wed Jul 17 05:21:04 2002 ++++ libmaa/arg.c Wed Jul 17 05:13:50 2002 +@@ -216,6 +216,9 @@ + ++pt; + + for (last = pt, len = 0; *pt; ++pt, ++len) { ++ if((*pt & 0x80) && pt[1]) { ++ ++pt, ++len; ++ } else + switch (*pt) { + case ' ': + case '\t':