The old code ignored succesful earlier matches for
patterns, and stopped looking on first non-matching
metadata pattern. Now it breaks on error or on first
matching pattern.
box = mailbox_alloc(info->ns->list, info->vname, MAILBOX_FLAG_READONLY);
mailbox_set_reason(box, "virtual mailbox metadata match");
for (i = 0; i < count; i++) {
- if ((ret = virtual_config_box_metadata_match(box, boxes[i], error_r)) <= 0)
+ /* break on error or match */
+ if ((ret = virtual_config_box_metadata_match(box, boxes[i], error_r)) < 0 || ret > 0)
break;
}
mailbox_free(&box);