changeset 1994:94529780bbcf

getenv calls UNIX getenv() when no special alternative is set
author Adam Chlipala <adam@chlipala.net>
date Fri, 07 Mar 2014 11:50:45 -0500
parents 3d1d44111906
children 057b08253a75 606af2c9b828
files src/c/urweb.c tests/getenv.ur
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/c/urweb.c	Tue Mar 04 08:46:33 2014 -0500
+++ b/src/c/urweb.c	Fri Mar 07 11:50:45 2014 -0500
@@ -3672,7 +3672,7 @@
   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) {
--- a/tests/getenv.ur	Tue Mar 04 08:46:33 2014 -0500
+++ b/tests/getenv.ur	Fri Mar 07 11:50:45 2014 -0500
@@ -1,3 +1,5 @@
 task initialize = fn _ =>
   v <- getenv (blessEnvVar "USER");
-  return {}
+  case v of
+      None => debug "No USER"
+    | Some u => debug u