diff options
Diffstat (limited to 'ldblib.c')
| -rw-r--r-- | ldblib.c | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -377,7 +377,7 @@ static int db_sethook (lua_State *L) { | |||
| 377 | } | 377 | } |
| 378 | if (!luaL_getsubtable(L, LUA_REGISTRYINDEX, HOOKKEY)) { | 378 | if (!luaL_getsubtable(L, LUA_REGISTRYINDEX, HOOKKEY)) { |
| 379 | /* table just created; initialize it */ | 379 | /* table just created; initialize it */ |
| 380 | lua_pushstring(L, "k"); | 380 | lua_pushliteral(L, "k"); |
| 381 | lua_setfield(L, -2, "__mode"); /** hooktable.__mode = "k" */ | 381 | lua_setfield(L, -2, "__mode"); /** hooktable.__mode = "k" */ |
| 382 | lua_pushvalue(L, -1); | 382 | lua_pushvalue(L, -1); |
| 383 | lua_setmetatable(L, -2); /* metatable(hooktable) = hooktable */ | 383 | lua_setmetatable(L, -2); /* metatable(hooktable) = hooktable */ |
| @@ -420,7 +420,7 @@ static int db_debug (lua_State *L) { | |||
| 420 | for (;;) { | 420 | for (;;) { |
| 421 | char buffer[250]; | 421 | char buffer[250]; |
| 422 | lua_writestringerror("%s", "lua_debug> "); | 422 | lua_writestringerror("%s", "lua_debug> "); |
| 423 | if (fgets(buffer, sizeof(buffer), stdin) == 0 || | 423 | if (fgets(buffer, sizeof(buffer), stdin) == NULL || |
| 424 | strcmp(buffer, "cont\n") == 0) | 424 | strcmp(buffer, "cont\n") == 0) |
| 425 | return 0; | 425 | return 0; |
| 426 | if (luaL_loadbuffer(L, buffer, strlen(buffer), "=(debug command)") || | 426 | if (luaL_loadbuffer(L, buffer, strlen(buffer), "=(debug command)") || |
