Commit 4724e090 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

LUA: don't reinvent scandir

parent fd658c7d
...@@ -460,7 +460,6 @@ int vlclua_scripts_batch_execute( vlc_object_t *p_this, ...@@ -460,7 +460,6 @@ int vlclua_scripts_batch_execute( vlc_object_t *p_this,
{ {
int i_ret = VLC_EGENERIC; int i_ret = VLC_EGENERIC;
DIR *dir = NULL;
char **ppsz_filelist = NULL; char **ppsz_filelist = NULL;
char **ppsz_fileend = NULL; char **ppsz_fileend = NULL;
char **ppsz_file; char **ppsz_file;
...@@ -487,16 +486,8 @@ int vlclua_scripts_batch_execute( vlc_object_t *p_this, ...@@ -487,16 +486,8 @@ int vlclua_scripts_batch_execute( vlc_object_t *p_this,
ppsz_filelist = NULL; ppsz_filelist = NULL;
} }
if( dir )
{
closedir( dir );
}
msg_Dbg( p_this, "Trying Lua scripts in %s", *ppsz_dir ); msg_Dbg( p_this, "Trying Lua scripts in %s", *ppsz_dir );
dir = utf8_opendir( *ppsz_dir ); i_files = utf8_scandir( *ppsz_dir, &ppsz_filelist, file_select,
if( !dir ) continue;
i_files = utf8_loaddir( dir, &ppsz_filelist, file_select,
file_compare ); file_compare );
if( i_files < 1 ) continue; if( i_files < 1 ) continue;
ppsz_fileend = ppsz_filelist + i_files; ppsz_fileend = ppsz_filelist + i_files;
...@@ -528,8 +519,6 @@ int vlclua_scripts_batch_execute( vlc_object_t *p_this, ...@@ -528,8 +519,6 @@ int vlclua_scripts_batch_execute( vlc_object_t *p_this,
for( ppsz_dir = ppsz_dir_list; *ppsz_dir; ppsz_dir++ ) for( ppsz_dir = ppsz_dir_list; *ppsz_dir; ppsz_dir++ )
free( *ppsz_dir ); free( *ppsz_dir );
if( dir ) closedir( dir );
return i_ret; return i_ret;
} }
......
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