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:
parent
6a80f8df7c
commit
4a7620c882
|
@ -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!
|
||||
|
|
Loading…
Reference in New Issue