[vlc-commits] lua: Don't use NULL script directories
Hugo Beauzée-Luyssen
git at videolan.org
Tue Jan 16 14:27:54 CET 2018
vlc/vlc-3.0 | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue Jan 16 14:28:15 2018 +0100| [ced0c03d9d171e33362def2b413bb46685040c96] | committer: Hugo Beauzée-Luyssen
lua: Don't use NULL script directories
(cherry picked from commit 6f3d97f9896b6065ed7274fe4cdaeda2cf2e7925)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=ced0c03d9d171e33362def2b413bb46685040c96
---
modules/lua/vlc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/lua/vlc.c b/modules/lua/vlc.c
index ca214c9279..103d8eb621 100644
--- a/modules/lua/vlc.c
+++ b/modules/lua/vlc.c
@@ -225,13 +225,13 @@ int vlclua_dir_list(const char *luadirname, char ***restrict listp)
char *libdir = config_GetLibDir();
char *datadir = config_GetDataDir();
- bool both = strcmp(libdir, datadir);
+ bool both = libdir != NULL && datadir != NULL && strcmp(libdir, datadir);
/* Tokenized Lua scripts in architecture-specific data directory */
list = vlclua_dir_list_append(list, libdir, luadirname);
/* Source Lua Scripts in architecture-independent data directory */
- if (both)
+ if (both || libdir == NULL)
list = vlclua_dir_list_append(list, datadir, luadirname);
*list = NULL;
More information about the vlc-commits
mailing list