| 263 | |
| 264 | |
| 265 | static int handle_script (lua_State *L, char **argv) { |
| 266 | int status; |
| 267 | const char *fname = argv[0]; |
| 268 | if (strcmp(fname, "-") == 0 && strcmp(argv[-1], "--") != 0) |
| 269 | fname = NULL; /* stdin */ |
| 270 | status = luaL_loadfile(L, fname); |
| 271 | if (status == LUA_OK) { |
| 272 | int n = pushargs(L); /* push arguments to script */ |
| 273 | status = docall(L, n, LUA_MULTRET); |
| 274 | } |
| 275 | return report(L, status); |
| 276 | } |
| 277 | |
| 278 | |
| 279 | /* bits of various argument indicators in 'args' */ |