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
1 changed files with 5 additions and 3 deletions

View File

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