commit e22cdf7752bc4d19cc9dbfad8148e9ee90ee3524
parent a5eb48a3e69871eb3ed7df5fc09ae6bfea75fbd3
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Wed, 29 Dec 2004 16:56:12 -0200
better error messages when require fails for C module
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/loadlib.c b/loadlib.c
@@ -1,5 +1,5 @@
/*
-** $Id: loadlib.c,v 1.13 2004/12/22 17:43:27 roberto Exp roberto $
+** $Id: loadlib.c,v 1.14 2004/12/27 15:58:15 roberto Exp roberto $
** Dynamic library loader for Lua
** See Copyright Notice in lua.h
*
@@ -325,7 +325,7 @@ static const char *loadC (lua_State *L, const char *fname, const char *name) {
funcname = luaL_gsub(L, name, ".", LUA_OFSEP);
funcname = lua_pushfstring(L, "%s%s", POF, funcname);
if (ll_loadfunc(L, fname, funcname) != 1)
- luaL_error(L, "error loading package `%s' (%s)", name, lua_tostring(L, -1));
+ luaL_error(L, "error loading package `%s' (%s)", name, lua_tostring(L, -2));
return NULL; /* library loaded successfully */
}