path-util: introduce empty_to_root() and use it many places

This commit is contained in:
Yu Watanabe
2018-05-11 01:47:33 +09:00
parent 54138a8de1
commit 945403e6ed
7 changed files with 12 additions and 13 deletions
+3
View File
@@ -164,3 +164,6 @@ static inline const char *skip_dev_prefix(const char *p) {
}
bool empty_or_root(const char *root);
static inline const char *empty_to_root(const char *path) {
return isempty(path) ? "/" : path;
}