summaryrefslogtreecommitdiff
path: root/src/strv.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-06-18 06:06:24 +0200
committerLennart Poettering <lennart@poettering.net>2010-06-18 06:06:24 +0200
commitddb26e1818f67c2b97313d2ccf7468b2240ec086 (patch)
treebc21bc6b9a35e99b5d534e9ab7f3d0380fb32e35 /src/strv.c
parenteb22ac37f3e07b9c49a3f8fdc8cc02631faabcb4 (diff)
execute: add EnvironmentFile= option
Diffstat (limited to 'src/strv.c')
-rw-r--r--src/strv.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/strv.c b/src/strv.c
index 85599fe92c..01464e1e33 100644
--- a/src/strv.c
+++ b/src/strv.c
@@ -511,3 +511,31 @@ char **strv_env_delete(char **x, unsigned n_lists, ...) {
return r;
}
+
+char **strv_env_set(char **x, const char *p) {
+
+ char **k, **r;
+
+ if (!(r = new(char*, strv_length(x)+2)))
+ return NULL;
+
+ k = r;
+ if (env_append(r, &k, x) < 0)
+ goto fail;
+
+ if (!(*(k++) = strdup(p)))
+ goto fail;
+
+ *k = NULL;
+
+ return r;
+
+fail:
+ for (k--; k >= r; k--)
+ free(*k);
+
+ free(r);
+
+ return NULL;
+
+}