| 217 | |
| 218 | |
| 219 | static int handle_script (lua_State *L, char **argv) { |
| 220 | int status; |
| 221 | const char *fname = argv[0]; |
| 222 | if (strcmp(fname, "-") == 0 && strcmp(argv[-1], "--") != 0) |
| 223 | fname = NULL; /* stdin */ |
| 224 | status = luaL_loadfile(L, fname); |
| 225 | if (status == LUA_OK) { |
| 226 | int n = pushargs(L); /* push arguments to script */ |
| 227 | status = docall(L, n, LUA_MULTRET); |
| 228 | } |
| 229 | return report(L, status); |
| 230 | } |
| 231 | |
| 232 | |
| 233 | /* bits of various argument indicators in 'args' */ |