Commit 6a0d4bdd authored by Antoine Cellerier's avatar Antoine Cellerier

Include all authorized lua extensions in module search path too.

parent 16511fee
......@@ -704,20 +704,23 @@ error:
static int vlclua_add_modules_path_inner( lua_State *L, const char *psz_path )
{
/* FIXME: don't use luaL_dostring */
char *psz_command = NULL;
if( asprintf( &psz_command,
"package.path =[[%s"DIR_SEP"modules"DIR_SEP"?.lua;]]..package.path",
psz_path ) < 0 )
for( const char **ppsz_ext = ppsz_lua_exts; *ppsz_ext; ppsz_ext++ )
{
return 1;
}
char *psz_command = NULL;
if( asprintf( &psz_command,
"package.path =[[%s"DIR_SEP"modules"DIR_SEP"?.%s;]]..package.path",
psz_path, *ppsz_ext ) < 0 )
{
return 1;
}
if( luaL_dostring( L, psz_command ) )
{
if( luaL_dostring( L, psz_command ) )
{
free( psz_command );
return 1;
}
free( psz_command );
return 1;
}
free( psz_command );
return 0;
}
......
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