| 238 | |
| 239 | |
| 240 | static int handle_script (lua_State *L, char **argv) { |
| 241 | int status; |
| 242 | const char *fname = argv[0]; |
| 243 | if (strcmp(fname, "-") == 0 && strcmp(argv[-1], "--") != 0) |
| 244 | fname = NULL; /* stdin */ |
| 245 | status = luaL_loadfile(L, fname); |
| 246 | if (status == LUA_OK) { |
| 247 | int n = pushargs(L); /* push arguments to script */ |
| 248 | status = docall(L, n, LUA_MULTRET); |
| 249 | } |
| 250 | return report(L, status); |
| 251 | } |
| 252 | |
| 253 | |
| 254 | /* bits of various argument indicators in 'args' */ |