diff options
Diffstat (limited to 'ltests.c')
-rw-r--r-- | ltests.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltests.c,v 1.144 2002/11/14 16:59:16 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 1.145 2002/11/18 15:24:27 roberto Exp roberto $ |
3 | ** Internal Module for Debugging of the Lua Implementation | 3 | ** Internal Module for Debugging of the Lua Implementation |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -702,12 +702,14 @@ static void yieldf (lua_State *L, lua_Debug *ar) { | |||
702 | 702 | ||
703 | static int setyhook (lua_State *L) { | 703 | static int setyhook (lua_State *L) { |
704 | if (lua_isnoneornil(L, 1)) | 704 | if (lua_isnoneornil(L, 1)) |
705 | lua_sethook(L, NULL, 0); /* turn off hooks */ | 705 | lua_sethook(L, NULL, 0, 0); /* turn off hooks */ |
706 | else { | 706 | else { |
707 | const char *smask = luaL_checkstring(L, 1); | 707 | const char *smask = luaL_checkstring(L, 1); |
708 | unsigned long count = LUA_MASKCOUNT(luaL_optint(L, 2, 0)); | 708 | int count = luaL_optint(L, 2, 0); |
709 | if (strchr(smask, 'l')) count |= LUA_MASKLINE; | 709 | int mask = 0; |
710 | lua_sethook(L, yieldf, count); | 710 | if (strchr(smask, 'l')) mask |= LUA_MASKLINE; |
711 | if (count > 0) mask |= LUA_MASKCOUNT; | ||
712 | lua_sethook(L, yieldf, mask, count); | ||
711 | } | 713 | } |
712 | return 0; | 714 | return 0; |
713 | } | 715 | } |