summaryrefslogtreecommitdiffstats
path: root/src/basic/strv.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2024-02-22 10:47:23 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2024-03-07 18:49:44 +0100
commit9bc7493098a9b2cfc044e07be6d2690a2be99e13 (patch)
tree903a07abd1e6b1a8fd8685c04f400e1359a0797a /src/basic/strv.c
parentudevd: inline iterator variable (diff)
downloadsystemd-9bc7493098a9b2cfc044e07be6d2690a2be99e13.tar.xz
systemd-9bc7493098a9b2cfc044e07be6d2690a2be99e13.zip
strv: add helper to extend strv from both sides
Also, use the more correct type of 'const char* const*' for the input strv. This requires adding the cast in a few places, but also allows to remove some casts in others.
Diffstat (limited to 'src/basic/strv.c')
-rw-r--r--src/basic/strv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/basic/strv.c b/src/basic/strv.c
index 37199ebf04..b7946c8ba2 100644
--- a/src/basic/strv.c
+++ b/src/basic/strv.c
@@ -242,13 +242,13 @@ rollback:
return -ENOMEM;
}
-int strv_extend_strv_concat(char ***a, char * const *b, const char *suffix) {
+int strv_extend_strv_biconcat(char ***a, const char *prefix, const char* const *b, const char *suffix) {
int r;
STRV_FOREACH(s, b) {
char *v;
- v = strjoin(*s, suffix);
+ v = strjoin(strempty(prefix), *s, suffix);
if (!v)
return -ENOMEM;