summaryrefslogtreecommitdiff
path: root/src/test/test-env-replace.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-09-19 22:01:31 +0200
committerLennart Poettering <lennart@poettering.net>2012-09-19 22:01:31 +0200
commit57f3067825d9361d7487f272bfaff3b36c684c62 (patch)
tree5bd99a4794edbe89687af74754b29de8ecc27857 /src/test/test-env-replace.c
parent93e4c84bb3d6169a02a5ddd1cd0690ad64d20cd8 (diff)
util: fix bad strstrip() return value in normalize_env_assignment()
https://bugzilla.redhat.com/show_bug.cgi?id=858780
Diffstat (limited to 'src/test/test-env-replace.c')
-rw-r--r--src/test/test-env-replace.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/test-env-replace.c b/src/test/test-env-replace.c
index 4b6b884779..cd596a6e16 100644
--- a/src/test/test-env-replace.c
+++ b/src/test/test-env-replace.c
@@ -104,6 +104,22 @@ int main(int argc, char *argv[]) {
printf("%s\n", t);
free(t);
+ t = normalize_env_assignment(" xyz ");
+ printf("<%s>\n", t);
+ free(t);
+
+ t = normalize_env_assignment(" xyz = bar ");
+ printf("<%s>\n", t);
+ free(t);
+
+ t = normalize_env_assignment(" xyz = 'bar ' ");
+ printf("<%s>\n", t);
+ free(t);
+
+ t = normalize_env_assignment(" ' xyz' = 'bar ' ");
+ 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);