From: Timo Sirainen Date: Sat, 13 Dec 2008 11:53:26 +0000 (+0200) Subject: Added env_remove(). X-Git-Tag: 1.2.alpha5~20 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8e6e668126491f248d5305b5f7b15f46f03f07b1;p=thirdparty%2Fdovecot%2Fcore.git Added env_remove(). --HG-- branch : HEAD --- diff --git a/src/lib/env-util.c b/src/lib/env-util.c index 52721e5f15..33f4bb8377 100644 --- a/src/lib/env-util.c +++ b/src/lib/env-util.c @@ -17,6 +17,11 @@ void env_put(const char *env) i_fatal("putenv(%s) failed: %m", env); } +void env_remove(const char *name) +{ + unsetenv(name); +} + void env_clean(void) { #ifdef HAVE_CLEARENV diff --git a/src/lib/env-util.h b/src/lib/env-util.h index 3f05016004..73969c46eb 100644 --- a/src/lib/env-util.h +++ b/src/lib/env-util.h @@ -4,6 +4,8 @@ /* Add new environment variable. Wrapper to putenv(). Note that calls to this function allocates memory which isn't free'd until env_clean() is called. */ void env_put(const char *env); +/* Remove a single environment. */ +void env_remove(const char *name); /* Clear all environment variables. */ void env_clean(void);