diff options
author | Alberto Gonzalez Iniesta <agi@inittab.org> | 2013-05-17 12:00:05 +0200 |
---|---|---|
committer | Alberto Gonzalez Iniesta <agi@inittab.org> | 2013-05-17 12:00:05 +0200 |
commit | 7da22c96dd646047e97732832331c84528bdc95e (patch) | |
tree | 182180f14a3e23d52308d40654e1cf06b554944c /src/openvpn/misc.c | |
parent | 8a59dafbd02d0ee1faaf674f4420cdc412f13aea (diff) | |
parent | fcc893c0d8d245525cfb023b6e2a8aae086304cf (diff) |
Merge tag 'upstream/2.3.1'
Upstream version 2.3.1
Diffstat (limited to 'src/openvpn/misc.c')
-rw-r--r-- | src/openvpn/misc.c | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/src/openvpn/misc.c b/src/openvpn/misc.c index fcc8552..fa327f8 100644 --- a/src/openvpn/misc.c +++ b/src/openvpn/misc.c @@ -707,13 +707,6 @@ env_set_remove_from_environment (const struct env_set *es) static struct env_item *global_env = NULL; /* GLOBAL */ -void -manage_env (char *str) -{ - remove_env_item (str, true, &global_env); - add_env_item (str, false, &global_env, NULL); -} - #endif /* add/modify/delete environmental strings */ @@ -789,27 +782,18 @@ setenv_str_ex (struct env_set *es, if (value) val_tmp = string_mod_const (value, value_include, value_exclude, value_replace, &gc); - if (es) + ASSERT (es); + + if (val_tmp) { - if (val_tmp) - { - const char *str = construct_name_value (name_tmp, val_tmp, &gc); - env_set_add (es, str); + const char *str = construct_name_value (name_tmp, val_tmp, &gc); + env_set_add (es, str); #if DEBUG_VERBOSE_SETENV - msg (M_INFO, "SETENV_ES '%s'", str); + msg (M_INFO, "SETENV_ES '%s'", str); #endif - } - else - env_set_del (es, name_tmp); } else - { - char *str = construct_name_value (name_tmp, val_tmp, NULL); - if (platform_putenv(str)) - { - msg (M_WARN | M_ERRNO, "putenv('%s') failed", str); - } - } + env_set_del (es, name_tmp); gc_free (&gc); } |