- /* find each value to delete
- *
- * FIXME: need to optimize this operation too,
- * see modify_check_duplicates()
- */
- for ( i = 0; mod->sm_bvalues[i].bv_val != NULL; i++ ) {
- int rc;
- struct berval asserted;
+ /* find each value to delete */
+ for ( j = 0; a->a_vals[ j ].bv_val != NULL; j++ )
+ /* count existing values */ ;
+
+ nvals = (BerVarray)ch_calloc( j + 1, sizeof ( struct berval ) );
+
+ /* normalize existing values */
+ for ( j = 0; a->a_vals[ j ].bv_val != NULL; j++ ) {
+ rc = value_normalize( a->a_desc, SLAP_MR_EQUALITY,
+ &a->a_vals[ j ], &nvals[ j ], text );
+
+ if ( rc != LDAP_SUCCESS ) {
+ nvals[ j ].bv_val = NULL;
+ goto return_results;
+ }
+ }