base/init: fixed "unset" of vars

master
Harald Hoyer 2011-04-07 12:58:02 +02:00
parent a2cb4dbc82
commit 77e2cadd88
1 changed files with 8 additions and 2 deletions

View File

@ -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=""