summaryrefslogtreecommitdiff
path: root/src/lua/lua.c
diff options
context:
space:
mode:
authorLua Team <team@lua.org>2004-03-24 12:00:00 +0000
committerrepogen <>2004-03-24 12:00:00 +0000
commitced7bbbe7a257ce6de94069d5dbf6672aeafd4d9 (patch)
tree2a01a79e6a4f451dccd247c70310ad957204cefa /src/lua/lua.c
parente7731a8fb8a317aa5c444ef073bfad82fa5baa54 (diff)
downloadlua-github-5.1-work0.tar.gz
Lua 5.1-work05.1-work0
Diffstat (limited to 'src/lua/lua.c')
-rw-r--r--src/lua/lua.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/lua/lua.c b/src/lua/lua.c
index 28c84cb6..4e669c07 100644
--- a/src/lua/lua.c
+++ b/src/lua/lua.c
@@ -1,5 +1,5 @@
/*
-** $Id: lua.c,v 1.122 2003/04/03 13:34:42 roberto Exp $
+** $Id: lua.c,v 1.124 2003/10/23 18:06:22 roberto Exp $
** Lua stand-alone interpreter
** See Copyright Notice in lua.h
*/
@@ -117,10 +117,9 @@ static void l_message (const char *pname, const char *msg) {
static int report (int status) {
- const char *msg;
- if (status) {
- msg = lua_tostring(L, -1);
- if (msg == NULL) msg = "(error with no message)";
+ if (status && !lua_isnil(L, -1)) {
+ const char *msg = lua_tostring(L, -1);
+ if (msg == NULL) msg = "(error object is not a string)";
l_message(progname, msg);
lua_pop(L, 1);
}
@@ -155,10 +154,6 @@ static void getargs (char *argv[], int n) {
lua_pushstring(L, argv[i]);
lua_rawset(L, -3);
}
- /* arg.n = maximum index in table `arg' */
- lua_pushliteral(L, "n");
- lua_pushnumber(L, i-n-1);
- lua_rawset(L, -3);
}