From 5e371c0cd627b5628453813c180fa8d08a523af8 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Fri, 21 Feb 2014 03:07:11 +0100 Subject: [PATCH] store: Require name matchers to match string *and* regex if specified. --- src/core/store_lookup.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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; -- 2.30.2