summaryrefslogtreecommitdiffstats
path: root/player/lua.c
diff options
context:
space:
mode:
authorAvi Halachmi (:avih) <avihpit@yahoo.com>2014-12-15 01:31:30 +0200
committerwm4 <wm4@nowhere>2014-12-15 04:39:56 +0100
commit39e04e929483847a3e0722d86d53f69837ed99db (patch)
tree56901ce1b9d1cb35f05d3e059d2aca83319491ff /player/lua.c
parent06828f71a134e0b880601665c0daea78e6523633 (diff)
downloadmpv-39e04e929483847a3e0722d86d53f69837ed99db.tar.bz2
mpv-39e04e929483847a3e0722d86d53f69837ed99db.tar.xz
options: deprecate 'lua' based options/dirs for 'script'
- --lua and --lua-opts change to --script and --script-opts - 'lua' default script dirs change to 'scripts' - DOCS updated - 'lua-settings' dir was _not_ modified The old lua-based names/dirs still work, but display a warning. Signed-off-by: wm4 <wm4@nowhere>
Diffstat (limited to 'player/lua.c')
-rw-r--r--player/lua.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/player/lua.c b/player/lua.c
index 7f7fb69bce..992c237867 100644
--- a/player/lua.c
+++ b/player/lua.c
@@ -279,10 +279,16 @@ static void set_path(lua_State *L)
const char *path = lua_tostring(L, -1);
char *newpath = talloc_strdup(tmp, path ? path : "");
- char **luadir = mp_find_all_config_files(tmp, get_mpctx(L)->global, "lua");
- for (int i = 0; luadir && luadir[i]; i++) {
- newpath = talloc_asprintf_append(newpath, ";%s",
- mp_path_join(tmp, bstr0(luadir[i]), bstr0("?.lua")));
+ char *dirs[] = {"scripts", "lua", NULL};
+ for (int s = 0; dirs[s]; s++) {
+ char **luadir = mp_find_all_config_files(tmp, get_mpctx(L)->global,
+ dirs[s]);
+ for (int i = 0; luadir && luadir[i]; i++) {
+ // No need to display a warning for lua files in the deprecated
+ // 'lua' dirs since scripting.c already warned on them
+ newpath = talloc_asprintf_append(newpath, ";%s",
+ mp_path_join(tmp, bstr0(luadir[i]), bstr0("?.lua")));
+ }
}
lua_pushstring(L, newpath); // package path newpath