summaryrefslogtreecommitdiffstats
path: root/src/basic/string-util.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2025-01-15 09:31:35 +0100
committerLennart Poettering <lennart@poettering.net>2025-01-15 10:51:53 +0100
commit34467ffa3c1861021293fcfadb6ebc24775b6fda (patch)
tree5f5363a67aeb36ac60587186dc496d7ef71fa429 /src/basic/string-util.h
parentudev: several trivial fixlets (#36005) (diff)
downloadsystemd-34467ffa3c1861021293fcfadb6ebc24775b6fda.tar.xz
systemd-34467ffa3c1861021293fcfadb6ebc24775b6fda.zip
string-util: make strjoin() just a special case of strextend()
The functions are very similar, let's make them the same. If the first argument to strextend() is NULL instead of extending a string we'll allocate a fresh one and return that.
Diffstat (limited to '')
-rw-r--r--src/basic/string-util.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/basic/string-util.h b/src/basic/string-util.h
index a1592b6e6d..1bcb1c40e3 100644
--- a/src/basic/string-util.h
+++ b/src/basic/string-util.h
@@ -108,8 +108,7 @@ char* first_word(const char *s, const char *word) _pure_;
char* strnappend(const char *s, const char *suffix, size_t length);
-char* strjoin_real(const char *x, ...) _sentinel_;
-#define strjoin(a, ...) strjoin_real((a), __VA_ARGS__, NULL)
+#define strjoin(a, ...) strextend_with_separator_internal(NULL, NULL, a, __VA_ARGS__, NULL)
#define strjoina(a, ...) \
({ \