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

Include all authorized lua extensions in module search path too.

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