path-util: invert PATH_STARTSWITH_ACCEPT_DOT_DOT flag
As requested: https://github.com/systemd/systemd/pull/37572#pullrequestreview-2861928094
This commit is contained in:
@@ -45,13 +45,13 @@ int path_make_relative(const char *from, const char *to, char **ret);
|
||||
int path_make_relative_parent(const char *from_child, const char *to, char **ret);
|
||||
|
||||
typedef enum PathStartWithFlags {
|
||||
PATH_STARTSWITH_ACCEPT_DOT_DOT = 1U << 0,
|
||||
PATH_STARTSWITH_REFUSE_DOT_DOT = 1U << 0,
|
||||
PATH_STARTSWITH_RETURN_LEADING_SLASH = 1U << 1,
|
||||
} PathStartWithFlags;
|
||||
|
||||
char* path_startswith_full(const char *path, const char *prefix, PathStartWithFlags flags) _pure_;
|
||||
static inline char* path_startswith(const char *path, const char *prefix) {
|
||||
return path_startswith_full(path, prefix, PATH_STARTSWITH_ACCEPT_DOT_DOT);
|
||||
return path_startswith_full(path, prefix, 0);
|
||||
}
|
||||
|
||||
int path_compare(const char *a, const char *b) _pure_;
|
||||
|
||||
Reference in New Issue
Block a user