]> git.sur5r.net Git - openldap/commitdiff
Better fix for prev
authorHoward Chu <hyc@openldap.org>
Fri, 27 Feb 2009 01:31:31 +0000 (01:31 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 27 Feb 2009 01:31:31 +0000 (01:31 +0000)
servers/slapd/back-ldap/search.c
servers/slapd/back-meta/search.c

index 2539706e194b6cf9a74c14df5fde7bfc09b5571f..27e08e39eb22c0146a6f5168039f01c7ca0177f6 100644 (file)
@@ -819,10 +819,8 @@ ldap_build_entry(
                if ( attr->a_desc->ad_type->sat_flags & SLAP_AT_SORTED_VAL ) {
                        while ( attr->a_numvals > 1 ) {
                                int rc = slap_sort_vals( (Modifications *)attr, &text, &i, op->o_tmpmemctx );
-                               if ( rc != LDAP_TYPE_OR_VALUE_EXISTS ) {
-                                       attr->a_flags |= SLAP_ATTR_SORTED_VALS;
+                               if ( rc != LDAP_TYPE_OR_VALUE_EXISTS )
                                        break;
-                               }
 
                                /* Strip duplicate values */
                                if ( attr->a_nvals != attr->a_vals )
@@ -838,6 +836,7 @@ ldap_build_entry(
                                if ( attr->a_nvals != attr->a_vals )
                                        BER_BVZERO(&attr->a_vals[attr->a_numvals]);
                        }
+                       attr->a_flags |= SLAP_ATTR_SORTED_VALS;
                }
 
                *attrp = attr;
index 180cd7788e5c2b7ec5bde77b82097dd521d4a3fe..b0de33851d9d6f39143385ad75a59cc4a4a00379 100644 (file)
@@ -2168,10 +2168,8 @@ next_attr:;
                                while ( attr->a_numvals > 1 ) {
                                        int i;
                                        int rc = slap_sort_vals( (Modifications *)attr, &text, &i, op->o_tmpmemctx );
-                                       if ( rc != LDAP_TYPE_OR_VALUE_EXISTS ) {
-                                               attr->a_flags |= SLAP_ATTR_SORTED_VALS;
+                                       if ( rc != LDAP_TYPE_OR_VALUE_EXISTS )
                                                break;
-                                       }
 
                                        /* Strip duplicate values */
                                        if ( attr->a_nvals != attr->a_vals )
@@ -2187,6 +2185,7 @@ next_attr:;
                                        if ( attr->a_nvals != attr->a_vals )
                                                BER_BVZERO(&attr->a_vals[attr->a_numvals]);
                                }
+                               attr->a_flags |= SLAP_ATTR_SORTED_VALS;
                        }
                }
        }