summaryrefslogtreecommitdiff
path: root/src/lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua')
l---------src/lua/RCS1
-rw-r--r--src/lua/README2
-rw-r--r--src/lua/lua.c13
3 files changed, 6 insertions, 10 deletions
diff --git a/src/lua/RCS b/src/lua/RCS
new file mode 120000
index 00000000..1ae38936
--- /dev/null
+++ b/src/lua/RCS
@@ -0,0 +1 @@
+../RCS \ No newline at end of file
diff --git a/src/lua/README b/src/lua/README
index febd229a..fca1e900 100644
--- a/src/lua/README
+++ b/src/lua/README
@@ -2,7 +2,7 @@ This is lua, a sample Lua interpreter.
It can be used as a batch interpreter and also interactively.
There are man pages for it in both nroff and html in ../../doc.
-Usage: ./lua [options] [script [args]]. Available options are:
+Usage: lua [options] [script [args]]. Available options are:
- execute stdin as a file
-e stat execute string `stat'
-i enter interactive mode after executing `script'
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);
}