diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2024-02-22 10:47:23 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2024-03-07 18:49:44 +0100 |
commit | 9bc7493098a9b2cfc044e07be6d2690a2be99e13 (patch) | |
tree | 903a07abd1e6b1a8fd8685c04f400e1359a0797a /src/basic/strv.c | |
parent | udevd: inline iterator variable (diff) | |
download | systemd-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.c | 4 |
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; |