From f1da0657038159f78d4dce94776dde4b39df38fb Mon Sep 17 00:00:00 2001 From: Paul Kulchenko Date: Mon, 22 Aug 2022 21:37:42 -0700 Subject: [PATCH] Update to allow using MapContentType from redbean CLI --- tool/net/redbean.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tool/net/redbean.c b/tool/net/redbean.c index d7ad4bec0..ea768d260 100644 --- a/tool/net/redbean.c +++ b/tool/net/redbean.c @@ -5012,6 +5012,10 @@ static void LuaStart(void) { LuaSetConstant(L, "kLogWarn", kLogWarn); LuaSetConstant(L, "kLogError", kLogError); 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 } @@ -5171,12 +5175,6 @@ static void LuaInit(void) { #ifndef STATIC lua_State *L = GL; 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) { int rc = LuaInterpreter(L); LuaDestroy();