diff options
Diffstat (limited to 'lua.c')
| -rw-r--r-- | lua.c | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lua.c,v 1.160 2006/06/02 15:34:00 roberto Exp roberto $ | 2 | ** $Id: lua.c,v 1.161 2006/06/23 16:09: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 | */ |
| @@ -242,14 +242,14 @@ static int handle_script (lua_State *L, char **argv, int n) { | |||
| 242 | int narg = getargs(L, argv, n); /* collect arguments */ | 242 | int narg = getargs(L, argv, n); /* collect arguments */ |
| 243 | lua_setglobal(L, "arg"); | 243 | lua_setglobal(L, "arg"); |
| 244 | fname = argv[n]; | 244 | fname = argv[n]; |
| 245 | if (strcmp(fname, "-") == 0 && strcmp(argv[n-1], "--") != 0) | 245 | if (strcmp(fname, "-") == 0 && strcmp(argv[n-1], "--") != 0) |
| 246 | fname = NULL; /* stdin */ | 246 | fname = NULL; /* stdin */ |
| 247 | status = luaL_loadfile(L, fname); | 247 | status = luaL_loadfile(L, fname); |
| 248 | lua_insert(L, -(narg+1)); | 248 | lua_insert(L, -(narg+1)); |
| 249 | if (status == 0) | 249 | if (status == 0) |
| 250 | status = docall(L, narg, 0); | 250 | status = docall(L, narg, 0); |
| 251 | else | 251 | else |
| 252 | lua_pop(L, narg); | 252 | lua_pop(L, narg); |
| 253 | return report(L, status); | 253 | return report(L, status); |
| 254 | } | 254 | } |
| 255 | 255 | ||
