diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-02-03 15:38:24 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-02-03 15:38:24 -0200 |
| commit | 90d016980f47fb4f760be2356e715f92af9a7af8 (patch) | |
| tree | 9500a2755d37f83f8184fdd325c45f25115fd885 | |
| parent | b3996c55f6991a6f11bf7ead2df48034a2d84e8a (diff) | |
| download | lua-90d016980f47fb4f760be2356e715f92af9a7af8.tar.gz lua-90d016980f47fb4f760be2356e715f92af9a7af8.tar.bz2 lua-90d016980f47fb4f760be2356e715f92af9a7af8.zip | |
detail ('luaL_getmetatable' does not return a boolean, but a tag)
| -rw-r--r-- | lauxlib.c | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -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 | ||
| 288 | LUALIB_API int luaL_newmetatable (lua_State *L, const char *tname) { | 288 | LUALIB_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 */ |
