mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-22 13:33:56 +03:00
util: add strna() and is_path_absolute()
This commit is contained in:
parent
852618039b
commit
04fd6fe45b
8
util.h
8
util.h
@ -41,6 +41,14 @@ static inline const char* strnull(const char *s) {
|
||||
return s ? s : "(null)";
|
||||
}
|
||||
|
||||
static inline const char *strna(const char *s) {
|
||||
return s ? s : "n/a";
|
||||
}
|
||||
|
||||
static inline bool is_path_absolute(const char *p) {
|
||||
return *p == '/';
|
||||
}
|
||||
|
||||
bool endswith(const char *s, const char *postfix);
|
||||
bool startswith(const char *s, const char *prefix);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user