From: Lennart Poettering Date: Wed, 8 Jan 2020 11:23:57 +0000 (+0100) Subject: path-util: express PATH_IN_SET() through path_strv_contains() X-Git-Tag: v245-rc1~150^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3593fa60f2a1549a09335e88ca7553f548f07ad8;p=thirdparty%2Fsystemd.git path-util: express PATH_IN_SET() through path_strv_contains() --- diff --git a/src/basic/path-util.h b/src/basic/path-util.h index 3e8c12481be..f49a876f3d2 100644 --- a/src/basic/path-util.h +++ b/src/basic/path-util.h @@ -71,17 +71,7 @@ static inline bool path_equal_ptr(const char *a, const char *b) { } /* Note: the search terminates on the first NULL item. */ -#define PATH_IN_SET(p, ...) \ - ({ \ - char **_s; \ - bool _found = false; \ - STRV_FOREACH(_s, STRV_MAKE(__VA_ARGS__)) \ - if (path_equal(p, *_s)) { \ - _found = true; \ - break; \ - } \ - _found; \ - }) +#define PATH_IN_SET(p, ...) path_strv_contains(STRV_MAKE(__VA_ARGS__), p) char* path_startswith_strv(const char *p, char **set); #define PATH_STARTSWITH_SET(p, ...) path_startswith_strv(p, STRV_MAKE(__VA_ARGS__))