path-util: take char* const* for strv where appropriate

This commit is contained in:
Mike Yuan
2024-05-09 17:02:19 +08:00
parent 7b89efda6f
commit 63a0e57724
2 changed files with 14 additions and 7 deletions
+3 -3
View File
@@ -108,7 +108,7 @@ static inline int path_simplify_alloc(const char *path, char **ret) {
/* Note: the search terminates on the first NULL item. */
#define PATH_IN_SET(p, ...) path_strv_contains(STRV_MAKE(__VA_ARGS__), p)
char* path_startswith_strv(const char *p, char **set);
char* path_startswith_strv(const char *p, char * const *strv);
#define PATH_STARTSWITH_SET(p, ...) path_startswith_strv(p, STRV_MAKE(__VA_ARGS__))
int path_strv_make_absolute_cwd(char **l);
@@ -218,7 +218,7 @@ static inline const char* empty_to_root(const char *path) {
return isempty(path) ? "/" : path;
}
bool path_strv_contains(char **l, const char *path);
bool prefixed_path_strv_contains(char **l, const char *path);
bool path_strv_contains(char * const *l, const char *path);
bool prefixed_path_strv_contains(char * const *l, const char *path);
int path_glob_can_match(const char *pattern, const char *prefix, char **ret);