| 346 | |
| 347 | |
| 348 | static int handle_luainit (lua_State *L) { |
| 349 | const char *name = "=" LUA_INITVARVERSION; |
| 350 | const char *init = getenv(name + 1); |
| 351 | if (init == NULL) { |
| 352 | name = "=" LUA_INIT_VAR; |
| 353 | init = getenv(name + 1); /* try alternative name */ |
| 354 | } |
| 355 | if (init == NULL) return LUA_OK; |
| 356 | else if (init[0] == '@') |
| 357 | return dofile(L, init+1); |
| 358 | else |
| 359 | return dostring(L, init, name); |
| 360 | } |
| 361 | |
| 362 | |
| 363 | /* |