13
0

Return actual result from LuaState::do_file and luaL_dofile

This commit is contained in:
Nikolaus Gullotta 2020-11-25 09:30:15 -06:00
parent 8d0a655608
commit 77a7e7b81b
No known key found for this signature in database
GPG Key ID: A1D165A77A88B96C

View File

@ -604,8 +604,10 @@ main (int argc, char** argv)
lua_setglobal (L, "arg"); lua_setglobal (L, "arg");
} }
int res = 0;
if (argc > optind && 0 != strcmp (argv[optind], "-")) { if (argc > optind && 0 != strcmp (argv[optind], "-")) {
lua->do_file (argv[optind]); res = lua->do_file (argv[optind]);
if (!interactive) { if (!interactive) {
keep_running = false; keep_running = false;
} }
@ -616,7 +618,7 @@ main (int argc, char** argv)
} else if (is_tty () || interactive) { } else if (is_tty () || interactive) {
interactive_interpreter (); interactive_interpreter ();
} else { } else {
luaL_dofile (lua->getState (), NULL); res = luaL_dofile (lua->getState (), NULL);
} }
if (session) { if (session) {
@ -634,5 +636,5 @@ main (int argc, char** argv)
ARDOUR::cleanup (); ARDOUR::cleanup ();
delete event_loop; delete event_loop;
pthread_cancel_all (); pthread_cancel_all ();
return 0; return res;
} }