scripting: shorten a line

Also allows it to deal with NULL return values, which currently is not
needed, but may or may not be required at some point in the future (what
if malloc fails).
This commit is contained in:
wm4 2014-06-26 19:33:49 +02:00
parent 3e631b9cb8
commit 07bc199e35
1 changed files with 3 additions and 2 deletions

View File

@ -170,8 +170,9 @@ void mp_load_scripts(struct MPContext *mpctx)
// Load all lua scripts
void *tmp = talloc_new(NULL);
for (char **luadir = mp_find_all_config_files(tmp, mpctx->global, "lua"); *luadir; luadir++) {
files = list_script_files(tmp, *luadir);
char **luadir = mp_find_all_config_files(tmp, mpctx->global, "lua");
for (int i = 0; luadir && luadir[i]; i++) {
files = list_script_files(tmp, luadir[i]);
for (int n = 0; files && files[n]; n++)
mp_load_script(mpctx, files[n]);
}