From: Lennart Poettering Date: Mon, 29 Aug 2022 09:07:43 +0000 (+0200) Subject: hashmap: add comment explaining that set_fnmatch() handles fnmatch() errors as non... X-Git-Tag: v252-rc1~292 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8812f8fc653e8774098b726635d051477e416569;p=thirdparty%2Fsystemd.git hashmap: add comment explaining that set_fnmatch() handles fnmatch() errors as non-matches --- diff --git a/src/basic/hashmap.c b/src/basic/hashmap.c index ddd329c8743..8013ac6b8ef 100644 --- a/src/basic/hashmap.c +++ b/src/basic/hashmap.c @@ -2079,6 +2079,8 @@ static bool set_fnmatch_one(Set *patterns, const char *needle) { assert(needle); + /* Any failure of fnmatch() is treated as equivalent to FNM_NOMATCH, i.e. as non-matching pattern */ + SET_FOREACH(p, patterns) if (fnmatch(p, needle, 0) == 0) return true;