Skip to content

Commit

Permalink
util: add strna() and is_path_absolute()
Browse files Browse the repository at this point in the history
  • Loading branch information
poettering committed Nov 18, 2009
1 parent 8526180 commit 04fd6fe
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions util.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 04fd6fe

Please sign in to comment.