Merge pull request #23946 from poettering/tmpfiles-extrat-dir-fn

tmpfiles: port from basename()/dirname() → path_extract_direcory()/path_extract_filename()
This commit is contained in:
Lennart Poettering
2022-07-08 16:10:42 +02:00
committed by GitHub
2 changed files with 82 additions and 54 deletions
+6 -2
View File
@@ -43,12 +43,16 @@
#endif
static inline bool is_path(const char *p) {
assert(p);
if (!p) /* A NULL pointer is definitely not a path */
return false;
return strchr(p, '/');
}
static inline bool path_is_absolute(const char *p) {
assert(p);
if (!p) /* A NULL pointer is definitely not an absolute path */
return false;
return p[0] == '/';
}