Update redbean lua example code

This commit is contained in:
Justine Tunney 2022-04-25 09:31:28 -07:00
parent 451e3f73d9
commit 72e9be5c20
7 changed files with 56 additions and 51 deletions

View file

@ -5178,13 +5178,15 @@ static void LuaPrint(lua_State *L) {
char *b = 0;
const char *s;
n = lua_gettop(L);
for (i = 1; i <= n; i++) {
if (i > 1) appendw(&b, '\t');
LuaEncodeLuaData(L, &b, 64, "g", i);
if (n > 0) {
for (i = 1; i <= n; i++) {
if (i > 1) appendw(&b, '\t');
LuaEncodeLuaData(L, &b, 64, "g", i);
}
appendw(&b, '\n');
WRITE(1, b, appendz(b).i);
free(b);
}
appendw(&b, '\n');
WRITE(1, b, appendz(b).i);
free(b);
}
static void LuaInterpreter(lua_State *L) {