Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Jul 2002 03:52:32 +0800 (CST)
From:      Kuang-che Wu <kcwu@kcwu.dyndns.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/40741: New port: chinese/dictd 
Message-ID:  <200207181952.g6IJqWd36138@kcwu.dyndns.org>

next in thread | raw e-mail | index | archive | help

>Number:         40741
>Category:       ports
>Synopsis:       New port: chinese/dictd
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul 18 13:00:05 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Kuang-che Wu
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD m722 5.0-CURRENT FreeBSD 5.0-CURRENT #2: Sat Apr 6 14:30:47 CST 2002 root@m722:/usr/obj/usr/src/sys/M722 i386


	
>Description:
	big5-encoding fixed version of net/dictd
	
	So, with chinese/dictd-database, you can play it like
	$ dict '¥\¯à'
	
>How-To-Repeat:
	
>Fix:
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	dictd
#	dictd/Makefile
#	dictd/files
#	dictd/files/patch-index.c
#	dictd/files/patch-libmaa::arg.c
#
echo c - dictd
mkdir -p dictd > /dev/null 2>&1
echo x - dictd/Makefile
sed 's/^X//' >dictd/Makefile << 'END-of-dictd/Makefile'
X# New ports collection makefile for:	dictd
X# Date created:			19 July 2002
X# Whom:				Kuang-che Wu <kcwu@ck.tp.edu.tw>
X#
X# $FreeBSD$
X#
X
XCATEGORIES=	chinese
X
XMAINTAINER=	kcwu@ck.tp.edu.tw
X
XMASTERDIR=	${.CURDIR}/../../net/dictd
XEXTRA_PATCHES=	${.CURDIR}/files/patch-index.c \
X		${.CURDIR}/files/patch-libmaa::arg.c
X
X.include "${MASTERDIR}/Makefile"
X
XPKGNAMEPREFIX:=	${PKGNAMEPREFIX}tw-
END-of-dictd/Makefile
echo c - dictd/files
mkdir -p dictd/files > /dev/null 2>&1
echo x - dictd/files/patch-index.c
sed 's/^X//' >dictd/files/patch-index.c << 'END-of-dictd/files/patch-index.c'
X--- index.c.orig	Wed Jul 17 04:15:35 2002
X+++ index.c	Wed Jul 17 04:47:19 2002
X@@ -120,6 +120,15 @@
X    
X 				/* FIXME.  Optimize this inner loop. */
X    while (*word && start < end && *start != '\t') {
X+      if ((*start & 0x80) && start+1<end && start[1]!='\t') {
X+        if(start[0]!=word[0]) 
X+	  return ((unsigned)word[0]<(unsigned)start[0])?-2:1;
X+        if(start[1]!=word[1]) 
X+	  return ((unsigned)word[1]<(unsigned)start[1])?-2:1;
X+        word+=2;
X+        start+=2;
X+        continue;
X+      }
X       if (!isspacealnum(*start)) {
X 	 ++start;
X 	 continue;
X@@ -139,7 +148,11 @@
X       ++start;
X    }
X    
X-   while (*start != '\t' && !isspacealnum(*start)) ++start;
X+   while (*start != '\t' && !isspacealnum(*start))
X+     if((*start & 0x80) && start[1]!='\t')
X+       break;
X+     else
X+       ++start;
X 
X    PRINTF(DBG_SEARCH,("   result = %d\n",
X 		      *word ? 1 : ((*start != '\t') ? -1 : 0)));
X@@ -643,6 +656,7 @@
X    char       tmp;
X    dictWord   *datum;
X 
X+   if(*word & 0x80) return count;
X #define CHECK                                         \
X    if ((pt = dict_index_search(buf, database->index)) \
X        && !compare(buf, pt, database->index->end)) {  \
X@@ -724,6 +738,11 @@
X       if (isspace( *(const unsigned char *)w )) {
X          *pt++ = ' ';
X       } else {
X+         if((*w & 0x80) && *(w+1)) {
X+            *pt++=*w++;
X+            *pt++=*w;
X+            continue;
X+         }
X          if (!isalnum( *(const unsigned char *)w )) continue;
X          *pt++ = tolower(*w);
X       }
END-of-dictd/files/patch-index.c
echo x - dictd/files/patch-libmaa::arg.c
sed 's/^X//' >dictd/files/patch-libmaa::arg.c << 'END-of-dictd/files/patch-libmaa::arg.c'
X--- libmaa/arg.c.orig	Wed Jul 17 05:21:04 2002
X+++ libmaa/arg.c	Wed Jul 17 05:13:50 2002
X@@ -216,6 +216,9 @@
X       ++pt;
X 
X    for (last = pt, len = 0; *pt; ++pt, ++len) {
X+     if((*pt & 0x80) && pt[1]) {
X+       ++pt, ++len;
X+     } else
X       switch (*pt) {
X       case ' ':
X       case '\t':
END-of-dictd/files/patch-libmaa::arg.c
exit


	


>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200207181952.g6IJqWd36138>