Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patch(lua): discard basedir and DIR_SEP on UWP #3

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions patches/0001-lua-discard-basedir-and-DIR_SEP-on-UWP.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
From 7d9e7f13fc7147b1d7cd4718c2df4328b578a23a Mon Sep 17 00:00:00 2001
From: Johannes Kauffmann <johanneskauffmann@hotmail.com>
Date: Sun, 31 Oct 2021 11:13:25 +0100
Subject: [PATCH] lua: discard basedir and DIR_SEP on UWP

On UWP, the lua folder is deployed right next to the executable in the
app installation folder, but the path returned by config_GetUserDir
(which is basedir) points to the local packages folder, located in the
current user AppData folder. Therefore, discard basedir and the
directory separator, to allow VLC to find the lua folder.
---
modules/lua/vlc.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/modules/lua/vlc.c b/modules/lua/vlc.c
index f20f931f189..ab0e5a4f334 100644
--- a/modules/lua/vlc.c
+++ b/modules/lua/vlc.c
@@ -183,8 +183,12 @@ static char **vlclua_dir_list_append( char **restrict list, char *basedir,
if (unlikely(basedir == NULL))
return list;

+#ifndef VLC_WINSTORE_APP
if (likely(asprintf(list, "%s"DIR_SEP"lua"DIR_SEP"%s",
basedir, luadirname) != -1))
+#else
+ if (likely(asprintf(list, "lua"DIR_SEP"%s", luadirname) != -1))
+#endif
list++;

free(basedir);
--
GitLab