path-util: introduce path_simplify_and_warn()

This commit is contained in:
Yu Watanabe
2018-06-03 23:54:55 +09:00
parent 4805426279
commit 58a53adde5
2 changed files with 58 additions and 0 deletions
+8
View File
@@ -167,3 +167,11 @@ bool empty_or_root(const char *root);
static inline const char *empty_to_root(const char *path) {
return isempty(path) ? "/" : path;
}
enum {
PATH_CHECK_FATAL = 1 << 0, /* If not set, then error message is appended with 'ignoring'. */
PATH_CHECK_ABSOLUTE = 1 << 1,
PATH_CHECK_RELATIVE = 1 << 2,
};
int path_simplify_and_warn(char *path, unsigned flag, const char *unit, const char *filename, unsigned line, const char *lvalue);