Update to allow using MapContentType from redbean CLI

This commit is contained in:
Paul Kulchenko 2022-08-22 21:37:42 -07:00
parent 077f4d1bd2
commit f1da065703

View file

@ -5012,6 +5012,10 @@ static void LuaStart(void) {
LuaSetConstant(L, "kLogWarn", kLogWarn); LuaSetConstant(L, "kLogWarn", kLogWarn);
LuaSetConstant(L, "kLogError", kLogError); LuaSetConstant(L, "kLogError", kLogError);
LuaSetConstant(L, "kLogFatal", kLogFatal); LuaSetConstant(L, "kLogFatal", kLogFatal);
// create a list of custom content types
lua_pushlightuserdata(L, (void *)&ctIdx); // push address as unique key
lua_newtable(L);
lua_settable(L, LUA_REGISTRYINDEX); // registry[&ctIdx] = {}
#endif #endif
} }
@ -5171,12 +5175,6 @@ static void LuaInit(void) {
#ifndef STATIC #ifndef STATIC
lua_State *L = GL; lua_State *L = GL;
LuaSetArgv(L); LuaSetArgv(L);
// create a list of custom content types
lua_pushlightuserdata(L, (void *)&ctIdx); // push address as unique key
lua_newtable(L);
lua_settable(L, LUA_REGISTRYINDEX); // registry[&ctIdx] = {}
if (interpretermode) { if (interpretermode) {
int rc = LuaInterpreter(L); int rc = LuaInterpreter(L);
LuaDestroy(); LuaDestroy();