[vlc-commits] lua: Don't use NULL script directories
Hugo Beauzée-Luyssen
git at videolan.org
Tue Jan 16 14:27:21 CET 2018
vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue Jan 16 14:28:15 2018 +0100| [6f3d97f9896b6065ed7274fe4cdaeda2cf2e7925] | committer: Hugo Beauzée-Luyssen
lua: Don't use NULL script directories
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6f3d97f9896b6065ed7274fe4cdaeda2cf2e7925
---
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