cleanup: Remove faulty env processing functions

The env_set_add_to_environmenti() and env_set_remove_from_environment()
functions where not used in the code at all and they would cause an
ASSERT() in setenv_str_ex() later on, as it would not allow the
struct env_set *es pointer to be NULL (misc.c:807).

Signed-off-by: David Sommerseth <davids@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20170225020229.17287-1-davids@openvpn.net>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14195.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
This commit is contained in:
David Sommerseth 2017-02-25 03:02:29 +01:00 committed by Gert Doering
parent 3c748aeb5e
commit a87f119afc
2 changed files with 0 additions and 55 deletions

View file

@ -701,57 +701,6 @@ env_set_inherit(struct env_set *es, const struct env_set *src)
}
}
void
env_set_add_to_environment(const struct env_set *es)
{
if (es)
{
struct gc_arena gc = gc_new();
const struct env_item *e;
e = es->list;
while (e)
{
const char *name;
const char *value;
if (deconstruct_name_value(e->string, &name, &value, &gc))
{
setenv_str(NULL, name, value);
}
e = e->next;
}
gc_free(&gc);
}
}
void
env_set_remove_from_environment(const struct env_set *es)
{
if (es)
{
struct gc_arena gc = gc_new();
const struct env_item *e;
e = es->list;
while (e)
{
const char *name;
const char *value;
if (deconstruct_name_value(e->string, &name, &value, &gc))
{
setenv_del(NULL, name);
}
e = e->next;
}
gc_free(&gc);
}
}
/* add/modify/delete environmental strings */

View file

@ -161,10 +161,6 @@ void env_set_print(int msglevel, const struct env_set *es);
void env_set_inherit(struct env_set *es, const struct env_set *src);
void env_set_add_to_environment(const struct env_set *es);
void env_set_remove_from_environment(const struct env_set *es);
/* Make arrays of strings */
const char **make_env_array(const struct env_set *es,