summaryrefslogtreecommitdiffstats
path: root/player/scripting.c
diff options
context:
space:
mode:
authorKenneth Zhou <knthzh@gmail.com>2014-06-18 19:55:40 -0400
committerwm4 <wm4@nowhere>2014-06-26 19:37:25 +0200
commitcb250d490c14872f03bb0320179e48d05fe2539d (patch)
treedd27e22fcbb6e306175d041eb2b2c714b7079645 /player/scripting.c
parent8bb7d427e2180067f13f8dc5c5105029e9e00be7 (diff)
downloadmpv-cb250d490c14872f03bb0320179e48d05fe2539d.tar.bz2
mpv-cb250d490c14872f03bb0320179e48d05fe2539d.tar.xz
Basic xdg directory implementation
Search $XDG_CONFIG_HOME and $XDG_CONFIG_DIRS for config files. This also negates the need to have separate user and global variants of mp_find_config_file() Closes #864, #109. Signed-off-by: wm4 <wm4@nowhere>
Diffstat (limited to 'player/scripting.c')
-rw-r--r--player/scripting.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/player/scripting.c b/player/scripting.c
index 7b3d408030..2272f3c2ee 100644
--- a/player/scripting.c
+++ b/player/scripting.c
@@ -167,11 +167,11 @@ void mp_load_scripts(struct MPContext *mpctx)
}
if (!mpctx->opts->auto_load_scripts)
return;
- // Load ~/.mpv/lua/*
+
+ // Load all lua scripts
void *tmp = talloc_new(NULL);
- char *script_path = mp_find_user_config_file(tmp, mpctx->global, "lua");
- if (script_path) {
- files = list_script_files(tmp, script_path);
+ for (char **luadir = mp_find_all_config_files(tmp, mpctx->global, "lua"); *luadir; luadir++) {
+ files = list_script_files(tmp, *luadir);
for (int n = 0; files && files[n]; n++)
mp_load_script(mpctx, files[n]);
}