diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-03-27 12:30:41 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-03-27 12:30:41 -0300 |
commit | d1f220217beadc102a8d44b8e930a92a9f54b001 (patch) | |
tree | 01e599fc7808818ad008599f192b57d32e97c995 /ldblib.c | |
parent | 405e3a4597d6f935a7ac224ce67dce660e69c7be (diff) | |
download | lua-d1f220217beadc102a8d44b8e930a92a9f54b001.tar.gz lua-d1f220217beadc102a8d44b8e930a92a9f54b001.tar.bz2 lua-d1f220217beadc102a8d44b8e930a92a9f54b001.zip |
when possible, library functions accept nil as none
Diffstat (limited to 'ldblib.c')
-rw-r--r-- | ldblib.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldblib.c,v 1.43 2002/02/07 17:24:32 roberto Exp roberto $ | 2 | ** $Id: ldblib.c,v 1.44 2002/03/20 12:54:08 roberto Exp roberto $ |
3 | ** Interface from Lua to its debug API | 3 | ** Interface from Lua to its debug API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -141,7 +141,7 @@ static void linef (lua_State *L, lua_Debug *ar) { | |||
141 | static void sethook (lua_State *L, const char *key, lua_Hook hook, | 141 | static void sethook (lua_State *L, const char *key, lua_Hook hook, |
142 | lua_Hook (*sethookf)(lua_State * L, lua_Hook h)) { | 142 | lua_Hook (*sethookf)(lua_State * L, lua_Hook h)) { |
143 | lua_settop(L, 1); | 143 | lua_settop(L, 1); |
144 | if (lua_isnil(L, 1)) | 144 | if (lua_isnoneornil(L, 1)) |
145 | (*sethookf)(L, NULL); | 145 | (*sethookf)(L, NULL); |
146 | else if (lua_isfunction(L, 1)) | 146 | else if (lua_isfunction(L, 1)) |
147 | (*sethookf)(L, hook); | 147 | (*sethookf)(L, hook); |