diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-04-14 14:44:20 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-04-14 14:44:20 -0300 |
commit | 4aa9ad6514a98fd4e25015f29e04877e67d9772d (patch) | |
tree | 1c4f47aef895ef6abf837e190204eb353b18be11 /ldblib.c | |
parent | d76b1a0eefc51384c75ffc0b847c212ad98f20f8 (diff) | |
download | lua-4aa9ad6514a98fd4e25015f29e04877e67d9772d.tar.gz lua-4aa9ad6514a98fd4e25015f29e04877e67d9772d.tar.bz2 lua-4aa9ad6514a98fd4e25015f29e04877e67d9772d.zip |
functions must return explicit `nil' on failure
Diffstat (limited to 'ldblib.c')
-rw-r--r-- | ldblib.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldblib.c,v 1.11 2000/03/03 14:58:26 roberto Exp roberto $ | 2 | ** $Id: ldblib.c,v 1.12 2000/03/30 17:19:48 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 | */ |
@@ -88,6 +88,7 @@ static void getlocal (lua_State *L) { | |||
88 | lua_pushstring(L, lvar.name); | 88 | lua_pushstring(L, lvar.name); |
89 | lua_pushobject(L, lvar.value); | 89 | lua_pushobject(L, lvar.value); |
90 | } | 90 | } |
91 | else lua_pushnil(L); | ||
91 | } | 92 | } |
92 | 93 | ||
93 | 94 | ||
@@ -100,6 +101,7 @@ static void setlocal (lua_State *L) { | |||
100 | lvar.value = luaL_nonnullarg(L, 3); | 101 | lvar.value = luaL_nonnullarg(L, 3); |
101 | if (lua_setlocal(L, &ar, &lvar)) | 102 | if (lua_setlocal(L, &ar, &lvar)) |
102 | lua_pushstring(L, lvar.name); | 103 | lua_pushstring(L, lvar.name); |
104 | else lua_pushnil(L); | ||
103 | } | 105 | } |
104 | 106 | ||
105 | 107 | ||