mirror of https://github.com/mpv-player/mpv
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:
parent
3e631b9cb8
commit
07bc199e35
|
@ -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]);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue