| 372 | |
| 373 | |
| 374 | static int handle_luainit (lua_State *L) { |
| 375 | const char *name = "=" LUA_INITVARVERSION; |
| 376 | const char *init = getenv(name + 1); |
| 377 | if (init == NULL) { |
| 378 | name = "=" LUA_INIT_VAR; |
| 379 | init = getenv(name + 1); /* try alternative name */ |
| 380 | } |
| 381 | if (init == NULL) return LUA_OK; |
| 382 | else if (init[0] == '@') |
| 383 | return dofile(L, init+1); |
| 384 | else |
| 385 | return dostring(L, init, name); |
| 386 | } |
| 387 | |
| 388 | |
| 389 | /* |