- while (*dn1 == ' ') dn1++;
- while (*dn2 == ' ') dn2++;
- while (*dn1 || *dn2) {
- if (*dn1 != '=' && *dn1 != ','
- && *dn2 != '=' && *dn2 != ',')
- {
- c1 = *dn1++;
- c2 = *dn2++;
- if (c1 >= 'a' && c1 <= 'z')
- c1 -= 'a' - 'A';
- if (c2 >= 'a' && c2 <= 'z')
- c2 -= 'a' - 'A';
- if (c1 != c2)
- return(0);
- } else {
- while (*dn1 == ' ') dn1++;
- while (*dn2 == ' ') dn2++;
- if (*dn1++ != *dn2++)
- return(0);
- while (*dn1 == ' ') dn1++;
- while (*dn2 == ' ') dn2++;
+ if ( BER_BVISNULL( set ) ) {
+ return set;
+ }
+
+ nset = cp->op->o_tmpcalloc( 1, sizeof(struct berval), cp->op->o_tmpmemctx );
+ if ( nset == NULL ) {
+ slap_set_dispose( cp, set, 0 );
+ return NULL;
+ }
+ for ( i = 0; !BER_BVISNULL( &set[ i ] ); i++ ) {
+ vals = (gatherer)( cp, &set[ i ], desc );
+ if ( vals != NULL ) {
+ nset = slap_set_join( cp, nset, '|', vals );
+ }
+ }
+ slap_set_dispose( cp, set, 0 );
+
+ if ( closure ) {
+ for ( i = 0; !BER_BVISNULL( &nset[ i ] ); i++ ) {
+ vals = (gatherer)( cp, &nset[ i ], desc );
+ if ( vals != NULL ) {
+ nset = slap_set_join( cp, nset, '|', vals );
+ if ( nset == NULL ) {
+ break;
+ }
+ }