[mod_magnet] adjust magnet_lighty_result_get()

rarely used
  e.g. if indexing into the content table before assigning a table
personal/stbuehler/tests-path
Glenn Strauss 2022-02-16 23:57:29 -05:00
parent 23a5107232
commit 9727eb1768
1 changed files with 2 additions and 2 deletions

View File

@ -1899,9 +1899,9 @@ static int magnet_lighty_result_get(lua_State *L) {
if (lua_isnil(L, -1)) {
const_buffer k = magnet_checkconstbuffer(L, 2);
if (k.len == 7 && 0 == memcmp(k.ptr, "content", 7)) {
lua_pop(L, 1); /* pop nil */
lua_createtable(L, 0, 0); /* create "content" table on demand */
lua_pushvalue(L, -1);
lua_pushvalue(L, 2); /* k: "content" */
lua_pushvalue(L, -2); /* v: table */
lua_rawset(L, 3); /* set in "lighty.result" */
}
}