summaryrefslogtreecommitdiff
path: root/ldblib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-03-27 12:30:41 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-03-27 12:30:41 -0300
commitd1f220217beadc102a8d44b8e930a92a9f54b001 (patch)
tree01e599fc7808818ad008599f192b57d32e97c995 /ldblib.c
parent405e3a4597d6f935a7ac224ce67dce660e69c7be (diff)
downloadlua-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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ldblib.c b/ldblib.c
index e379acfd..886dddb8 100644
--- a/ldblib.c
+++ b/ldblib.c
@@ -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) {
141static void sethook (lua_State *L, const char *key, lua_Hook hook, 141static 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);