comparison src/c/urweb.c @ 1993:3d1d44111906

Change Basis.getenv to return None outside the context of a web request
author Adam Chlipala <adam@chlipala.net>
date Tue, 04 Mar 2014 08:46:33 -0500
parents 7075acda4456
children 94529780bbcf
comparison
equal deleted inserted replaced
1992:7075acda4456 1993:3d1d44111906
3667 3667
3668 return uw_unit_v; 3668 return uw_unit_v;
3669 } 3669 }
3670 3670
3671 uw_Basis_string uw_Basis_getenv(uw_context ctx, uw_Basis_string name) { 3671 uw_Basis_string uw_Basis_getenv(uw_context ctx, uw_Basis_string name) {
3672 return ctx->get_env(ctx->get_env_data, name); 3672 if (ctx->get_env)
3673 return ctx->get_env(ctx->get_env_data, name);
3674 else
3675 return NULL;
3673 } 3676 }
3674 3677
3675 uw_Basis_string uw_unnull(uw_Basis_string s) { 3678 uw_Basis_string uw_unnull(uw_Basis_string s) {
3676 return s ? s : ""; 3679 return s ? s : "";
3677 } 3680 }