MCPcopy Create free account
hub / github.com/DFHack/dfhack / handle_luainit

Function handle_luainit

depends/lua/src/lua.c:535–547  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

pmainFunction · 0.85

Calls 2

dofileFunction · 0.85
dostringFunction · 0.85

Tested by

no test coverage detected