summaryrefslogtreecommitdiff
path: root/src/test-env-replace.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-01-06 20:38:02 +0100
committerLennart Poettering <lennart@poettering.net>2011-01-06 20:38:02 +0100
commita6ff950e71ea665fff99740f7b3e0137d451a79e (patch)
tree502ff29d4c0d410285e54666571b1831061e6af0 /src/test-env-replace.c
parent7fc942b29e7bdb9d6aa3123f53da6680edabd8f0 (diff)
execute: drop empty assignments from env blocks on execution but keep them around otherwise to make them visible
Diffstat (limited to 'src/test-env-replace.c')
-rw-r--r--src/test-env-replace.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/test-env-replace.c b/src/test-env-replace.c
index 37dd7ff590..4188c67dde 100644
--- a/src/test-env-replace.c
+++ b/src/test-env-replace.c
@@ -47,7 +47,7 @@ int main(int argc, char *argv[]) {
NULL
};
- char **i, **r, *t;
+ char **i, **r, *t, **a, **b;
r = replace_env_argv((char**) line, (char**) env);
@@ -96,5 +96,24 @@ int main(int argc, char *argv[]) {
printf("%s\n", t);
free(t);
+ a = strv_new("FOO=BAR", "WALDO=WALDO", "WALDO=", "PIEP", "SCHLUMPF=SMURF", NULL);
+ b = strv_new("FOO=KKK", "FOO=", "PIEP=", "SCHLUMPF=SMURFF", "NANANANA=YES", NULL);
+
+ r = strv_env_merge(2, a, b);
+ strv_free(a);
+ strv_free(b);
+
+ STRV_FOREACH(i, r)
+ printf("%s\n", *i);
+
+ printf("CLEANED UP:\n");
+
+ r = strv_env_clean(r);
+
+ STRV_FOREACH(i, r)
+ printf("%s\n", *i);
+
+ strv_free(r);
+
return 0;
}