diff options
| author | Li Jin <dragon-fly@qq.com> | 2021-01-05 16:48:53 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2021-01-05 16:48:53 +0800 |
| commit | 71b9532659abb531bd1597d88451426dcc895824 (patch) | |
| tree | c9b50856b37f759c9a31e1a6e761e77b51996fa6 /src/lua/ldblib.c | |
| parent | e3a31f9945053d8e8d9e4ef3d2e4c9abe563cff2 (diff) | |
| download | yuescript-71b9532659abb531bd1597d88451426dcc895824.tar.gz yuescript-71b9532659abb531bd1597d88451426dcc895824.tar.bz2 yuescript-71b9532659abb531bd1597d88451426dcc895824.zip | |
update Lua.
Diffstat (limited to 'src/lua/ldblib.c')
| -rw-r--r-- | src/lua/ldblib.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lua/ldblib.c b/src/lua/ldblib.c index 5a326ad..15593bf 100644 --- a/src/lua/ldblib.c +++ b/src/lua/ldblib.c | |||
| @@ -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)") || |
