From: Kurt Zeilenga Date: Wed, 1 Sep 1999 07:29:07 +0000 (+0000) Subject: if/else clause was reversed and attr->values used where values X-Git-Tag: TWEB_OL_BASE~51 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f252bde68179b515191c1c07da6240e21c02a953;p=openldap if/else clause was reversed and attr->values used where values should have been. --- diff --git a/servers/slapd/tools/slapindex.c b/servers/slapd/tools/slapindex.c index 77abcd9798..40207cf38a 100644 --- a/servers/slapd/tools/slapindex.c +++ b/servers/slapd/tools/slapindex.c @@ -55,7 +55,6 @@ main( int argc, char **argv ) id != NOID; id = be->be_entry_next( be ) ) { - Attribute *attr; struct berval **values; Entry* e = be->be_entry_get( be, id ); struct berval bv; @@ -75,7 +74,15 @@ main( int argc, char **argv ) } if( strcasecmp( type, "dn" ) == 0 ) { - attr = attr_find( e->e_attrs, type ); + bv.bv_val = e->e_ndn; + bv.bv_len = strlen( bv.bv_val ); + bvals[0] = &bv; + bvals[1] = NULL; + + values = bvals; + + } else { + Attribute *attr = attr_find( e->e_attrs, type ); if( attr == NULL ) { entry_free( e ); @@ -83,18 +90,10 @@ main( int argc, char **argv ) } values = attr->a_vals; - - } else { - bv.bv_val = e->e_ndn; - bv.bv_len = strlen( bv.bv_val ); - bvals[0] = &bv; - bvals[1] = NULL; - - values = bvals; } if ( be->be_index_change( be, - type, attr->a_vals, id, SLAP_INDEX_ADD_OP ) ) + type, values, id, SLAP_INDEX_ADD_OP ) ) { rc = EXIT_FAILURE;