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)
(let* ((env (thread-read-env))
(alist (alist-update
var
val
(fold cons '() (env:alist env)))))
(alist (if val
(alist-update
var
val
(env:alist env))
(alist-delete
var
(env:alist env)))))
(thread-set-env!
(make-env
#f
alist
))))
alist))))
(define (alist->env alist)
(thread-set-env!