summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-01-21 21:23:42 +0100
committerwm4 <wm4@nowhere>2014-01-21 21:23:42 +0100
commit0a4fc15d26e8a8b8e75de417fd745088a8eb72a1 (patch)
treee78a9dc3af9efa9f2c0df238bd3f6d88aef347d3 /player
parent63a76b3d1ceaa2cefb0bdc81a2c6d79e4bb447eb (diff)
downloadmpv-0a4fc15d26e8a8b8e75de417fd745088a8eb72a1.tar.bz2
mpv-0a4fc15d26e8a8b8e75de417fd745088a8eb72a1.tar.xz
lua: allow ~ path convention for --lua
Paths passed to the --lua option now follow the convention for paths starting with ~ documented in mpv.rst.
Diffstat (limited to 'player')
-rw-r--r--player/lua.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/player/lua.c b/player/lua.c
index ca92aa009d..79bf61b713 100644
--- a/player/lua.c
+++ b/player/lua.c
@@ -134,11 +134,13 @@ static int load_file(struct script_ctx *ctx, const char *fname)
{
int r = 0;
lua_State *L = ctx->state;
- if (luaL_loadfile(L, fname) || lua_pcall(L, 0, 0, 0)) {
+ char *res_name = mp_get_user_path(NULL, ctx->mpctx->global, fname);
+ if (luaL_loadfile(L, res_name) || lua_pcall(L, 0, 0, 0)) {
report_error(L);
r = -1;
}
assert(lua_gettop(L) == 0);
+ talloc_free(res_name);
return r;
}