Commit 272e0c47 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

lua: don't scan same directory twice

parent 573d7fd6
......@@ -223,11 +223,16 @@ int vlclua_dir_list(const char *luadirname, char ***restrict listp)
list = vlclua_dir_list_append(list, config_GetUserDir(VLC_DATA_DIR),
char *libdir = config_GetLibDir();
char *datadir = config_GetDataDir();
bool both = strcmp(libdir, datadir);
/* Tokenized Lua scripts in architecture-specific data directory */
list = vlclua_dir_list_append(list, config_GetLibDir(), luadirname);
list = vlclua_dir_list_append(list, libdir, luadirname);
/* Source Lua Scripts in architecture-independent data directory */
list = vlclua_dir_list_append(list, config_GetDataDir(), luadirname);
if (both)
list = vlclua_dir_list_append(list, datadir, luadirname);
*list = NULL;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment