util-lib: make localed's nonempty() generic, rename it to empty_to_null() and make use of it everywhere

This commit is contained in:
Lennart Poettering
2016-05-30 17:59:43 +02:00
parent c6f8d17de0
commit 3c6f7c3402
7 changed files with 26 additions and 52 deletions
+4
View File
@@ -66,6 +66,10 @@ static inline bool isempty(const char *p) {
return !p || !p[0];
}
static inline const char *empty_to_null(const char *p) {
return isempty(p) ? NULL : p;
}
static inline char *startswith(const char *s, const char *prefix) {
size_t l;