| 435 | |
| 436 | |
| 437 | static int handle_script (lua_State *L, char **argv) { |
| 438 | int status; |
| 439 | const char *fname = argv[0]; |
| 440 | if (strcmp(fname, "-") == 0 && strcmp(argv[-1], "--") != 0) |
| 441 | fname = NULL; /* stdin */ |
| 442 | status = luaL_loadfile(L, fname); |
| 443 | if (status == LUA_OK) { |
| 444 | int n = pushargs(L); /* push arguments to script */ |
| 445 | status = docall(L, n, LUA_MULTRET); |
| 446 | } |
| 447 | return report(L, status); |
| 448 | } |
| 449 | |
| 450 | |
| 451 |