Explorar o código

Bug 693455 - nsMatchingRule does not work with multiple values

https://bugzilla.redhat.com/show_bug.cgi?id=693455
Resolves: bug 693455
Bug Description: nsMatchingRule does not work with multiple values
Reviewed by: nkinder (Thanks!)
Branch: master
Fix Description: The variable isFirst was not being used correctly.  Instead
of using it, just use tmpBuf[0] to see if this is the first iteration or
not.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
Rich Megginson %!s(int64=14) %!d(string=hai) anos
pai
achega
58902a28c0
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  1. 1 2
      ldap/servers/slapd/back-ldbm/ldbm_index_config.c

+ 1 - 2
ldap/servers/slapd/back-ldbm/ldbm_index_config.c

@@ -202,12 +202,11 @@ static int ldbm_index_parse_entry(ldbm_instance *inst, Slapi_Entry *e,
     tmpBuf[0] = 0;
     /* Get the list of matching rules from the entry. */
     if (0 == slapi_entry_attr_find(e, "nsMatchingRule", &attr)) {
-        isFirst = 1;
         for (i = slapi_attr_first_value(attr, &sval); i != -1;
              i = slapi_attr_next_value(attr, i, &sval)) {
             attrValue = slapi_value_get_berval(sval);
             if (NULL != attrValue->bv_val && strlen(attrValue->bv_val) > 0) {
-                if (isFirst) {
+                if (0 == tmpBuf[0]) {
                     ZCAT_SAFE(tmpBuf, "", attrValue->bv_val);
                 } else {
                     ZCAT_SAFE(tmpBuf, ",", attrValue->bv_val);