From: Sebastian Harl Date: Fri, 21 Feb 2014 02:07:11 +0000 (+0100) Subject: store: Require name matchers to match string *and* regex if specified. X-Git-Tag: sysdb-0.1.0~193 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5e371c0cd627b5628453813c180fa8d08a523af8;p=sysdb.git store: Require name matchers to match string *and* regex if specified. --- diff --git a/src/core/store_lookup.c b/src/core/store_lookup.c index 089b99f..26e4666 100644 --- a/src/core/store_lookup.c +++ b/src/core/store_lookup.c @@ -126,12 +126,12 @@ match_name(name_matcher_t *m, const char *name) if (! name) name = ""; - if (m->name && (! strcasecmp(m->name, name))) - return 0; - if (m->name_re && (! regexec(m->name_re, name, - /* matches */ 0, NULL, /* flags = */ 0))) - return 0; - return -1; + if (m->name && strcasecmp(m->name, name)) + return -1; + if (m->name_re && regexec(m->name_re, name, + /* matches */ 0, NULL, /* flags = */ 0)) + return -1; + return 0; } /* match_name */ /* match attribute specific values;