diff options
-rw-r--r-- | lauxlib.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lauxlib.c,v 1.63 2002/03/27 15:30:41 roberto Exp roberto $ | 2 | ** $Id: lauxlib.c,v 1.64 2002/04/02 20:42:49 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 | */ |
@@ -46,6 +46,7 @@ LUALIB_API void luaL_argerror (lua_State *L, int narg, const char *extramsg) { | |||
46 | lua_Debug ar; | 46 | lua_Debug ar; |
47 | lua_getstack(L, 0, &ar); | 47 | lua_getstack(L, 0, &ar); |
48 | lua_getinfo(L, "n", &ar); | 48 | lua_getinfo(L, "n", &ar); |
49 | if (strcmp(ar.namewhat, "method") == 0) narg--; /* do not count `self' */ | ||
49 | if (ar.name == NULL) | 50 | if (ar.name == NULL) |
50 | ar.name = "?"; | 51 | ar.name = "?"; |
51 | luaL_verror(L, "bad argument #%d to `%.50s' (%.100s)", | 52 | luaL_verror(L, "bad argument #%d to `%.50s' (%.100s)", |