Code

store_lookup: Let attribute matchers check the attribute name.
authorSebastian Harl <sh@tokkee.org>
Thu, 19 Jun 2014 14:41:23 +0000 (16:41 +0200)
committerSebastian Harl <sh@tokkee.org>
Thu, 19 Jun 2014 14:41:23 +0000 (16:41 +0200)
src/core/store_lookup.c

index fe98e91dd62c7a72e3509a61e07e0ee610ea223a..f2d8cc7dd03bc2fd2cdc044af397ec9fecd0cfda 100644 (file)
@@ -243,6 +243,9 @@ match_attr(sdb_store_matcher_t *m, sdb_store_base_t *obj)
                sdb_attribute_t *attr = SDB_ATTR(sdb_llist_iter_get_next(iter));
                char buf[sdb_data_strlen(&attr->value) + 1];
 
+               if (ATTR_M(m)->name && strcasecmp(ATTR_M(m)->name, SDB_OBJ(attr)->name))
+                       continue;
+
                if (sdb_data_format(&attr->value, buf, sizeof(buf), SDB_UNQUOTED) <= 0)
                        return 0;
                if (match_obj_name(&ATTR_M(m)->value, buf)) {