getenv now returns #f for unset environment variables.
This commit is contained in:
parent
73f045a6c3
commit
b037b1b671
|
@ -309,15 +309,18 @@
|
|||
($file-time x 'file-mtime
|
||||
(lambda (u) (foreign-call "ikrt_file_mtime2" u))))
|
||||
|
||||
(define ($getenv-bv key)
|
||||
(foreign-call "ikrt_getenv" key))
|
||||
(define ($getenv-str key)
|
||||
(utf8->string ($getenv-bv (string->utf8 key))))
|
||||
|
||||
|
||||
(define (getenv key)
|
||||
(define who 'getenv)
|
||||
(define ($getenv-str key)
|
||||
(define ($getenv-bv key)
|
||||
(foreign-call "ikrt_getenv" key))
|
||||
(let ([rv ($getenv-bv (string->utf8 key))])
|
||||
(and rv (utf8->string rv))))
|
||||
(if (string? key)
|
||||
($getenv-str key)
|
||||
(die 'getenv "the key is not a string" key)))
|
||||
(die who "key is not a string" key)))
|
||||
|
||||
(define env
|
||||
(let ()
|
||||
|
|
|
@ -1 +1 @@
|
|||
1697
|
||||
1698
|
||||
|
|
|
@ -908,12 +908,7 @@ ikrt_getenv(ikptr bv, ikpcb* pcb){
|
|||
return s;
|
||||
}
|
||||
else {
|
||||
/* empty bv */
|
||||
ikptr s = ik_safe_alloc(pcb, align(disp_bytevector_data+1))
|
||||
+ bytevector_tag;
|
||||
ref(s, -bytevector_tag) = fix(0);
|
||||
ref(s, off_bytevector_data) = 0;
|
||||
return s;
|
||||
return false_object;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue