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)
|
(define (setenv var val)
|
||||||
(let* ((env (thread-read-env))
|
(let* ((env (thread-read-env))
|
||||||
(alist (alist-update
|
(alist (if val
|
||||||
|
(alist-update
|
||||||
var
|
var
|
||||||
val
|
val
|
||||||
(fold cons '() (env:alist env)))))
|
(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!
|
||||||
|
|
Loading…
Reference in New Issue