aboutsummaryrefslogtreecommitdiff
path: root/lua.c
diff options
context:
space:
mode:
Diffstat (limited to 'lua.c')
-rw-r--r--lua.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/lua.c b/lua.c
index e128d4d6..3734f84e 100644
--- a/lua.c
+++ b/lua.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.c,v 1.40 2000/06/16 17:16:34 roberto Exp roberto $ 2** $Id: lua.c,v 1.41 2000/06/19 13:15:15 roberto Exp roberto $
3** Lua stand-alone interpreter 3** Lua stand-alone interpreter
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -175,17 +175,16 @@ int main (int argc, char *argv[]) {
175 int toclose = 0; 175 int toclose = 0;
176 int status = EXIT_SUCCESS; 176 int status = EXIT_SUCCESS;
177 int i = 1; 177 int i = 1;
178 int stacksize = 0;
178 if (i < argc && argv[1][0] == '-' && argv[1][1] == 's') { 179 if (i < argc && argv[1][0] == '-' && argv[1][1] == 's') {
179 int stacksize = atoi(&argv[1][2]); 180 stacksize = atoi(&argv[1][2]);
180 if (stacksize == 0) { 181 if (stacksize == 0) {
181 fprintf(stderr, "lua: invalid stack size ('%s')\n", &argv[1][2]); 182 fprintf(stderr, "lua: invalid stack size ('%s')\n", &argv[1][2]);
182 exit(EXIT_FAILURE); 183 exit(EXIT_FAILURE);
183 } 184 }
184 i++; 185 i++;
185 lua_state = lua_newstate("stack", stacksize, NULL);
186 } 186 }
187 else 187 lua_state = lua_newstate(stacksize, 1);
188 lua_state = lua_newstate(NULL);
189 lua_userinit(); 188 lua_userinit();
190 lua_pushuserdata(argv); 189 lua_pushuserdata(argv);
191 lua_pushcclosure(l_getargs, 1); 190 lua_pushcclosure(l_getargs, 1);