From: Stig Venaas Date: Wed, 31 Jan 2001 15:58:00 +0000 (+0000) Subject: Using UTF8normcmp() from lunicode, removing our own UTF8casecmp() X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~1521 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ac95c255a89d4d0c65b3f61dd74c97728845d2ae;p=openldap Using UTF8normcmp() from lunicode, removing our own UTF8casecmp() --- diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index 921cab74c3..518e46290f 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -496,60 +496,6 @@ booleanMatch( } #if UTF8MATCH -static int -UTF8casecmp( - struct berval *right, - struct berval *left ) -{ - ber_len_t r, l; - int rlen, llen; - ldap_unicode_t ru, lu; - ldap_unicode_t ruu, luu; - - for( r=0, l=0; - r < right->bv_len && l < left->bv_len; - r+=rlen, l+=llen ) - { - /* - * XXYYZ: we convert to ucs4 even though -llunicode - * expects ucs2 in an unsigned long - */ - ru = ldap_utf8_to_ucs4( &right->bv_val[r] ); - if( ru == LDAP_UCS4_INVALID ) { - return 1; - } - - lu = ldap_utf8_to_ucs4( &left->bv_val[l] ); - if( lu == LDAP_UCS4_INVALID ) { - return -1; - } - - ruu = uctoupper( ru ); - luu = uctoupper( lu ); - - if( ruu > luu ) { - return 1; - } else if( luu > ruu ) { - return -1; - } - - rlen = LDAP_UTF8_CHARLEN( &right->bv_val[r] ); - llen = LDAP_UTF8_CHARLEN( &left->bv_val[l] ); - } - - if( r < right->bv_len ) { - /* less left */ - return -1; - } - - if( l < left->bv_len ) { - /* less right */ - return 1; - } - - return 0; -} - /* case insensitive UTF8 strncmp with offset for second string */ static int UTF8oncasecmp( @@ -1664,7 +1610,9 @@ caseIgnoreMatch( void *assertedValue ) { #if UTF8MATCH - *matchp = UTF8casecmp( value, (struct berval *) assertedValue ); + *matchp = UTF8normcmp( value->bv_val, + ((struct berval *) assertedValue)->bv_val, + UTF8_CASEFOLD ); #else int match = value->bv_len - ((struct berval *) assertedValue)->bv_len;