Fixed bug in setenv: #f was not handled as deleting the variable.

Also removed superfluous list-copying before call to alist-update as
this has no side effects.
This commit is contained in:
mainzelm 2002-04-28 18:47:00 +00:00
parent 6a80f8df7c
commit 4a7620c882
1 changed files with 9 additions and 6 deletions

View File

@ -309,15 +309,18 @@
(define (setenv var val) (define (setenv var val)
(let* ((env (thread-read-env)) (let* ((env (thread-read-env))
(alist (alist-update (alist (if val
var (alist-update
val var
(fold cons '() (env:alist env))))) val
(env:alist env))
(alist-delete
var
(env:alist env)))))
(thread-set-env! (thread-set-env!
(make-env (make-env
#f #f
alist alist))))
))))
(define (alist->env alist) (define (alist->env alist)
(thread-set-env! (thread-set-env!