mes: Add setenv.
* src/posix.c (setenv_): New function. * tests/base.test ("setenv, getenv"): Test it.
This commit is contained in:
parent
bd82d5988d
commit
6932d83d82
|
@ -135,6 +135,15 @@ getenv_ (SCM s) ///((name . "getenv"))
|
|||
return p ? MAKE_STRING (cstring_to_list (p)) : cell_f;
|
||||
}
|
||||
|
||||
SCM
|
||||
setenv_ (SCM s, SCM v) ///((name . "setenv"))
|
||||
{
|
||||
char buf[1024];
|
||||
strcpy (buf, string_to_cstring (s));
|
||||
setenv (buf, string_to_cstring (v), 1);
|
||||
return cell_unspecified;
|
||||
}
|
||||
|
||||
SCM
|
||||
access_p (SCM file_name, SCM mode)
|
||||
{
|
||||
|
|
|
@ -116,4 +116,11 @@ exit $?
|
|||
(pass-if-not "#<eof>"
|
||||
(char? (integer->char -1))))
|
||||
|
||||
(pass-if-equal "setenv, getenv"
|
||||
"bar"
|
||||
(begin
|
||||
(setenv "foo" "bar")
|
||||
(getenv "bar")
|
||||
(getenv "foo")))
|
||||
|
||||
(result 'report)
|
||||
|
|
Loading…
Reference in a new issue