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