From 8812f8fc653e8774098b726635d051477e416569 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 29 Aug 2022 11:07:43 +0200 Subject: [PATCH] hashmap: add comment explaining that set_fnmatch() handles fnmatch() errors as non-matches --- src/basic/hashmap.c | 2 ++ 1 file changed, 2 insertions(+) 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; -- 2.47.3