lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 6336d2f9e16613c85a38a5f422041a730bff0d80
parent ec6677e5512257a42d7d443d6b621b3a2d8e0d43
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Fri,  5 Jul 1996 17:55:23 -0300

flag for direct execution is "-e"; argument with an "=" goes to
direct execution, independently of flags.

Diffstat:
Mlua.c | 5++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lua.c b/lua.c @@ -39,7 +39,6 @@ int main (int argc, char *argv[]) iolib_open (); strlib_open (); mathlib_open (); - if (argc < 2) manual_input(); else for (i=1; i<argc; i++) { @@ -48,8 +47,8 @@ int main (int argc, char *argv[]) else if (strcmp(argv[i], "-v") == 0) printf("%s %s\n(written by %s)\n\n", LUA_VERSION, LUA_COPYRIGHT, LUA_AUTHORS); - else if (strcmp(argv[i], "-x") == 0) { - if (lua_dostring(argv[++i]) != 0) { + else if ((strcmp(argv[i], "-e") == 0 && i++) || strchr(argv[i], '=')) { + if (lua_dostring(argv[i]) != 0) { fprintf(stderr, "lua: error running argument `%s'\n", argv[i]); return 1; }