Commit 04aae4db authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

No need to do stat() before opendir()!

parent cca9e206
......@@ -283,13 +283,7 @@ int vlclua_opendir( lua_State *L )
const char *psz_dir = luaL_checkstring( L, 1 );
DIR *p_dir;
int i = 0;
#ifdef HAVE_SYS_STAT_H
struct stat s;
if( utf8_stat( psz_dir, &s ) == -1 )
return luaL_error( L, "Error while trying to stat `%s'.", psz_dir );
if( !S_ISDIR( s.st_mode ) )
return luaL_error( L, "`%s' is not a directory.", psz_dir );
#endif
if( ( p_dir = utf8_opendir( psz_dir ) ) == NULL )
return luaL_error( L, "cannot open directory `%s'.", psz_dir );
......
Supports Markdown
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