summaryrefslogtreecommitdiff
path: root/src/basic/path-util.h
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-03-28 22:35:46 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-07-19 16:49:41 +0200
commitcc4d7d818df8e1cdd04553783f4c4289030e300d (patch)
tree55e4bc6f4d513c9d922c32447c132203400fade4 /src/basic/path-util.h
parent771fded37f4858375a1d3f5f30ffc72fdc9fbed6 (diff)
downloadsystemd-cc4d7d818df8e1cdd04553783f4c4289030e300d.tar.gz
path-util: add path_startswith_strv()
Diffstat (limited to 'src/basic/path-util.h')
-rw-r--r--src/basic/path-util.h13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/basic/path-util.h b/src/basic/path-util.h
index 4a1ed0a1a8..9d0bca3ef4 100644
--- a/src/basic/path-util.h
+++ b/src/basic/path-util.h
@@ -71,17 +71,8 @@ static inline bool path_equal_ptr(const char *a, const char *b) {
_found; \
})
-#define PATH_STARTSWITH_SET(p, ...) \
- ({ \
- const char *_p = (p); \
- char *_found = NULL, **_i; \
- STRV_FOREACH(_i, STRV_MAKE(__VA_ARGS__)) { \
- _found = path_startswith(_p, *_i); \
- if (_found) \
- break; \
- } \
- _found; \
- })
+char* path_startswith_strv(const char *p, char **set);
+#define PATH_STARTSWITH_SET(p, ...) path_startswith_strv(p, STRV_MAKE(__VA_ARGS__))
int path_strv_make_absolute_cwd(char **l);
char** path_strv_resolve(char **l, const char *root);