From 77e2cadd88350a756736009067c8d742096bc770 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 7 Apr 2011 12:58:02 +0200 Subject: [PATCH] base/init: fixed "unset" of vars --- modules.d/99base/init | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules.d/99base/init b/modules.d/99base/init index 415bc1d..e85b83b 100755 --- a/modules.d/99base/init +++ b/modules.d/99base/init @@ -324,10 +324,16 @@ done for i in $(export -p); do i=${i#declare -x} i=${i#export} + strstr "$i" "=" || continue # skip RD_ vars - [ "$i" != "${i#RD_}" ] && continue i=${i%%=*} - [ "$i" = "root" -o "$i" = "PATH" -o "$i" = "HOME" -o "$i" = "TERM" ] || unset $i + [ -z "$i" ] && continue + case $i in + root|PATH|HOME|TERM|PS4|RD_*) + :;; + *) + unset "$i";; + esac done initargs="" -- 2.7.4