Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Jul 2002 06:55:40 +0800 (CST)
From:      Kuang-che Wu <kcwu@kcwu.dyndns.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/40743: chinese/dictd: fix pr 40741
Message-ID:  <200207182255.g6IMteo48140@kcwu.dyndns.org>

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

>Number:         40743
>Category:       ports
>Synopsis:       chinese/dictd: fix pr 40741
>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 16:00:07 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:
	replace files/patch-index.c in pr 40741 with this one
	
>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:
#
#	files/patch-index.c
#
echo x - files/patch-index.c
sed 's/^X//' >files/patch-index.c << 'END-of-files/patch-index.c'
X--- index.c.orig	Mon Apr 29 22:43:42 2002
X+++ index.c	Fri Jul 19 05:23:01 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@@ -315,7 +328,6 @@
X    int        count = 0;
X    dictWord   *datum;
X    const char *previous = NULL;
X-   
X    while (pt && pt < database->index->end) {
X       if (!compare( word, pt, database->index->end )) {
X 	 if (!previous || altcompare(previous, pt, database->index->end)) {
X@@ -643,6 +655,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 +737,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       }
X@@ -790,6 +808,11 @@
X 	 = binary_search( buf, i->start, i->end );
X    }
X    for (j = '0'; j <= '9'; j++) {
X+      buf[0] = j;
X+      buf[1] = '\0';
X+      i->optStart[j] = binary_search( buf, i->start, i->end );
X+   }
X+   for (j = 0x80; j <= 255; j++) {
X       buf[0] = j;
X       buf[1] = '\0';
X       i->optStart[j] = binary_search( buf, i->start, i->end );
END-of-files/patch-index.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?200207182255.g6IMteo48140>