const char *name
)
{
- struct aindexrec *air;
- char *tmpname;
-
- {
- tmpname = (char *)name;
- }
+ struct aindexrec *air;
- if ( (air = (struct aindexrec *) avl_find( attr_index, tmpname,
- (AVL_CMP) attr_index_name_cmp )) != NULL ) {
- if ( tmpname != name )
- ldap_memfree( tmpname );
- return( air->air_at );
- }
+ air = (struct aindexrec *) avl_find( attr_index, name,
+ (AVL_CMP) attr_index_name_cmp );
- if ( tmpname != name )
- ldap_memfree( tmpname );
- return( NULL );
+ return air != NULL ? air->air_at : NULL;
}
int
int
at_add(
- LDAP_ATTRIBUTE_TYPE *at,
+ LDAPAttributeType *at,
const char **err
)
{
return SLAP_SCHERR_ATTR_INCOMPLETE;
}
sat = (AttributeType *) ch_calloc( 1, sizeof(AttributeType) );
- memcpy( &sat->sat_atype, at, sizeof(LDAP_ATTRIBUTE_TYPE));
+ AC_MEMCPY( &sat->sat_atype, at, sizeof(LDAPAttributeType));
sat->sat_cname = cname;
if ( sat->sat_sup ) {
sat->sat_syntax = sat->sat_sup->sat_syntax;
sat->sat_equality = sat->sat_sup->sat_equality;
+ sat->sat_approx = sat->sat_sup->sat_approx;
sat->sat_ordering = sat->sat_sup->sat_ordering;
sat->sat_substr = sat->sat_sup->sat_substr;
}
if ( sat->sat_equality_oid ) {
if ( (mr = mr_find(sat->sat_equality_oid)) ) {
sat->sat_equality = mr;
+ sat->sat_approx = mr->smr_associated;
} else {
*err = sat->sat_equality_oid;
return SLAP_SCHERR_MR_NOT_FOUND;