| 531 | |
| 532 | |
| 533 | static int handle_luainit(lua_State *L) { |
| 534 | const char *name = "=" LUA_INITVARVERSION; |
| 535 | const char *init = getenv(name + 1); |
| 536 | if (init == nullptr) { |
| 537 | name = "=" LUA_INIT_VAR; |
| 538 | init = getenv(name + 1); /* try alternative name */ |
| 539 | } |
| 540 | if (init == nullptr) return LUA_OK; |
| 541 | else if (init[0] == '@') |
| 542 | return dofile(L, init + 1); |
| 543 | else |
| 544 | return dostring(L, init, name); |
| 545 | } |
| 546 | |
| 547 | |
| 548 | /* |