[vlc-commits] lua: io: Simplify readdir

Hugo Beauzée-Luyssen git at videolan.org
Tue Apr 10 18:27:37 CEST 2018


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue Apr 10 17:09:10 2018 +0200| [dbafe08dfa0e88942aff92cf0e70793fe305bbe3] | committer: Hugo Beauzée-Luyssen

lua: io: Simplify readdir

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=dbafe08dfa0e88942aff92cf0e70793fe305bbe3
---

 modules/lua/libs/io.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/modules/lua/libs/io.c b/modules/lua/libs/io.c
index 1ea8bc6774..acb94c491d 100644
--- a/modules/lua/libs/io.c
+++ b/modules/lua/libs/io.c
@@ -222,21 +222,7 @@ static int vlclua_io_readdir( lua_State *L )
     int idx = 1;
     while ( ( psz_entry = vlc_readdir( p_dir ) ) != NULL )
     {
-        char path[PATH_MAX];
-        struct stat st;
-
-        if (snprintf(path, PATH_MAX, "%s"DIR_SEP"%s", psz_path,
-                     psz_entry) >= PATH_MAX || vlc_stat( path, &st ) )
-            continue;
-        lua_newtable( L );
-
-        lua_pushstring( L, path );
-        lua_setfield( L, -2, "path" );
         lua_pushstring( L, psz_entry );
-        lua_setfield( L, -2, "filename" );
-        lua_pushboolean( L, S_ISDIR( st.st_mode) );
-        lua_setfield( L, -2, "isDir" );
-
         lua_rawseti( L, -2, idx );
         idx++;
     }



More information about the vlc-commits mailing list