aboutsummaryrefslogtreecommitdiff
path: root/lib/env.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/env.c')
-rw-r--r--lib/env.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/env.c b/lib/env.c
index 94ea0a4e..35ef688c 100644
--- a/lib/env.c
+++ b/lib/env.c
@@ -80,6 +80,12 @@ void xsetenv(char *name, char *val)
environ[i] = new;
}
+void xunsetenv(char *name)
+{
+ if (strchr(name, '=')) error_exit("xunsetenv %s name has =", name);
+ xsetenv(name, 0);
+}
+
// reset environment for a user, optionally clearing most of it
void reset_env(struct passwd *p, int clear)
{