| 215 | |
| 216 | #ifdef OS_VMS |
| 217 | else if ( ( module->name && object_equal( module->name, constant_ENVIRON ) ) |
| 218 | || root_module() == module ) |
| 219 | { |
| 220 | /* On VMS, when a variable from root or ENVIRON module is not found, |
| 221 | * explicitly request it from the process. |
| 222 | * By design, process variables (and logicals) are not made available |
| 223 | * to C main(), and thus will not get loaded in bulk to root/ENVRON. |
| 224 | * So we get around it by getting any such variable on first request. |
| 225 | */ |
| 226 | const char * val = getenv( object_str( symbol ) ); |
| 227 | |
| 228 | if ( val ) |
| 229 | { |
| 230 | struct module_t * environ_module = module; |
| 231 | char * environ[ 2 ] = { 0 }; /* NULL-terminated */ |
| 232 | string buf[ 1 ]; |
| 233 | |
| 234 | if ( root_module() == module ) |
| 235 | { |
| 236 | environ_module = bindmodule( constant_ENVIRON ); |
| 237 | } |
| 238 | |
| 239 | string_copy( buf, object_str( symbol ) ); |
| 240 | string_append( buf, "=" ); |
| 241 | string_append( buf, val ); |
| 242 | |
| 243 | environ[ 0 ] = buf->value; |
| 244 | |
| 245 | /* Load variable to global module, with splitting, for backward |
| 246 | * compatibility. Then to .ENVIRON, without splitting. |
| 247 | */ |
| 248 | var_defines( root_module(), environ, 1 ); |
| 249 | var_defines( environ_module, environ, 0 ); |
| 250 | string_free( buf ); |
| 251 | |
| 252 | if ( module->variables && ( v = (VARIABLE *)hash_find( |
| 253 | module->variables, symbol ) ) ) |
| 254 | { |
| 255 | if ( DEBUG_VARGET ) |
| 256 | var_dump( v->symbol, v->value, "get" ); |
| 257 | result = v->value; |
| 258 | } |
| 259 | } |
| 260 | } |
| 261 | #endif |
| 262 | } |
| 263 | return result; |
nothing calls this directly
no test coverage detected