| 255 | |
| 256 | |
| 257 | static int handle_script (lua_State *L, char **argv) { |
| 258 | int status; |
| 259 | const char *fname = argv[0]; |
| 260 | if (strcmp(fname, "-") == 0 && strcmp(argv[-1], "--") != 0) |
| 261 | fname = NULL; /* stdin */ |
| 262 | status = luaL_loadfile(L, fname); |
| 263 | if (status == LUA_OK) { |
| 264 | int n = pushargs(L); /* push arguments to script */ |
| 265 | status = docall(L, n, LUA_MULTRET); |
| 266 | } |
| 267 | return report(L, status); |
| 268 | } |
| 269 | |
| 270 | |
| 271 | /* bits of various argument indicators in 'args' */ |