aboutsummaryrefslogtreecommitdiff
path: root/lauxlib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2015-02-03 15:38:24 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2015-02-03 15:38:24 -0200
commit90d016980f47fb4f760be2356e715f92af9a7af8 (patch)
tree9500a2755d37f83f8184fdd325c45f25115fd885 /lauxlib.c
parentb3996c55f6991a6f11bf7ead2df48034a2d84e8a (diff)
downloadlua-90d016980f47fb4f760be2356e715f92af9a7af8.tar.gz
lua-90d016980f47fb4f760be2356e715f92af9a7af8.tar.bz2
lua-90d016980f47fb4f760be2356e715f92af9a7af8.zip
detail ('luaL_getmetatable' does not return a boolean, but a tag)
Diffstat (limited to 'lauxlib.c')
-rw-r--r--lauxlib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lauxlib.c b/lauxlib.c
index 4197f6bf..cd32f555 100644
--- a/lauxlib.c
+++ b/lauxlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lauxlib.c,v 1.278 2014/12/13 17:47:58 roberto Exp roberto $ 2** $Id: lauxlib.c,v 1.279 2014/12/14 18:32:26 roberto Exp roberto $
3** Auxiliary functions for building Lua libraries 3** Auxiliary functions for building Lua libraries
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -286,7 +286,7 @@ LUALIB_API int luaL_execresult (lua_State *L, int stat) {
286*/ 286*/
287 287
288LUALIB_API int luaL_newmetatable (lua_State *L, const char *tname) { 288LUALIB_API int luaL_newmetatable (lua_State *L, const char *tname) {
289 if (luaL_getmetatable(L, tname)) /* name already in use? */ 289 if (luaL_getmetatable(L, tname) != LUA_TNIL) /* name already in use? */
290 return 0; /* leave previous value on top, but return 0 */ 290 return 0; /* leave previous value on top, but return 0 */
291 lua_pop(L, 1); 291 lua_pop(L, 1);
292 lua_newtable(L); /* create metatable */ 292 lua_newtable(L); /* create metatable */