path-util: move empty_or_root_to_null() from chase.c
And rename it to empty_or_root_harder_to_null(), as it also checks if the input path effectively points to the root by calling path_is_root(). This also adds simple test cases for the function.
This commit is contained in:
@@ -179,6 +179,7 @@ static inline const char* skip_dev_prefix(const char *p) {
|
||||
|
||||
bool empty_or_root(const char *path) _pure_;
|
||||
const char* empty_to_root(const char *path) _pure_;
|
||||
int empty_or_root_harder_to_null(const char **path);
|
||||
|
||||
bool path_strv_contains(char * const *l, const char *path);
|
||||
bool prefixed_path_strv_contains(char * const *l, const char *path);
|
||||
|
||||
Reference in New Issue
Block a user