summaryrefslogtreecommitdiff
path: root/src/basic/string-util.h
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-06-04 18:47:56 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-06-04 18:47:56 -0400
commit20f8477be541f2486737f1be32bdb0bd0d6372fd (patch)
treeb99412abf9bf45fddc04ef330f5546059d3a444d /src/basic/string-util.h
parent3fb1ac5d57954bb0d881a68777e996b46ed44ce3 (diff)
parentac83514cbf5997938344d5fbcfcbfd5021f453f9 (diff)
Merge pull request #3392 from poettering/assorted-stuff
Assorted stuff
Diffstat (limited to 'src/basic/string-util.h')
-rw-r--r--src/basic/string-util.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/basic/string-util.h b/src/basic/string-util.h
index 139cc8c91b..1209e1e2e1 100644
--- a/src/basic/string-util.h
+++ b/src/basic/string-util.h
@@ -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;