From: Lennart Poettering Date: Wed, 18 Nov 2009 23:47:41 +0000 (+0100) Subject: util: add strna() and is_path_absolute() X-Git-Tag: 0.git+20100605+dfd8ee-1~461 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04fd6fe45b6c4e245a621578d2913296d1bb3642;p=systemd util: add strna() and is_path_absolute() --- diff --git a/util.h b/util.h index 2df67b73..60dc04e9 100644 --- a/util.h +++ b/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);