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