summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2014-03-07 11:50:45 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2014-03-07 11:50:45 -0500
commit2e3db71b6717f477ac24c4baa4fba1885cc55dad (patch)
treeed7e0ea4255dd3b12dc11a1e1d56747a7e33319c
parent5b61100181d61708ad6c1047bd96cecf43630004 (diff)
getenv calls UNIX getenv() when no special alternative is set
-rw-r--r--src/c/urweb.c2
-rw-r--r--tests/getenv.ur4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/c/urweb.c b/src/c/urweb.c
index 5ac5aa55..ffcc0146 100644
--- a/src/c/urweb.c
+++ b/src/c/urweb.c
@@ -3672,7 +3672,7 @@ uw_Basis_string uw_Basis_getenv(uw_context ctx, uw_Basis_string name) {
if (ctx->get_env)
return ctx->get_env(ctx->get_env_data, name);
else
- return NULL;
+ return getenv(name);
}
uw_Basis_string uw_unnull(uw_Basis_string s) {
diff --git a/tests/getenv.ur b/tests/getenv.ur
index 42f48096..a71a2822 100644
--- a/tests/getenv.ur
+++ b/tests/getenv.ur
@@ -1,3 +1,5 @@
task initialize = fn _ =>
v <- getenv (blessEnvVar "USER");
- return {}
+ case v of
+ None => debug "No USER"
+ | Some u => debug u