diff options
Diffstat (limited to 'src/shared/strv.h')
-rw-r--r-- | src/shared/strv.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/shared/strv.h b/src/shared/strv.h index afb31f385f..635e92b728 100644 --- a/src/shared/strv.h +++ b/src/shared/strv.h @@ -47,6 +47,10 @@ char **strv_uniq(char **l); char **strv_new(const char *x, ...) _sentinel_ _malloc_; char **strv_new_ap(const char *x, va_list ap) _malloc_; +static inline const char* STRV_IFNOTNULL(const char *x) { + return x ? x : (const char *) -1; +} + static inline bool strv_isempty(char **l) { return !l || !*l; } |