basic/env-util: add little helper to call setenv or unsetenv

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2020-11-10 15:48:14 +01:00
parent 55c540d39f
commit 063f9f0da9
5 changed files with 21 additions and 14 deletions
+1 -4
View File
@@ -372,10 +372,7 @@ static void test_environment_gathering(void) {
assert_se(streq(strv_env_get(env, "PATH"), DEFAULT_PATH ":/no/such/file"));
/* reset environ PATH */
if (old)
(void) setenv("PATH", old, 1);
else
(void) unsetenv("PATH");
assert_se(set_unset_env("PATH", old, true) == 0);
}
static void test_error_catching(void) {