Fix exit status for 'luajit -b'.

This commit is contained in:
Mike Pall 2016-07-22 16:42:09 +02:00
parent c98660c8c3
commit 972a1a4cc6

View File

@ -387,7 +387,7 @@ static int dobytecode(lua_State *L, char **argv)
for (argv++; *argv != NULL; narg++, argv++)
lua_pushstring(L, *argv);
report(L, lua_pcall(L, narg, 0, 0));
return 1;
return -1;
}
/* check that argument has no extra characters at the end */
@ -580,6 +580,6 @@ int main(int argc, char **argv)
status = lua_cpcall(L, pmain, NULL);
report(L, status);
lua_close(L);
return (status || smain.status) ? EXIT_FAILURE : EXIT_SUCCESS;
return (status || smain.status > 0) ? EXIT_FAILURE : EXIT_SUCCESS;
}