diff options
| -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 */ |
