[vlc-devel] [PATCH 04/11] playlist/directory: refactor

Thomas Guillem thomas at gllm.fr
Fri Apr 1 10:31:03 CEST 2016


---
 modules/demux/playlist/directory.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/modules/demux/playlist/directory.c b/modules/demux/playlist/directory.c
index f6b0bf1..e357952 100644
--- a/modules/demux/playlist/directory.c
+++ b/modules/demux/playlist/directory.c
@@ -163,13 +163,13 @@ static int Demux( demux_t *p_demux )
     {
         int i_name_len = p_item->psz_name ? strlen( p_item->psz_name ) : 0;
 
-        /* skip "." and ".." and hidden files if option is activated */
-        if( ( !b_show_hiddenfiles && i_name_len > 0 &&
-              p_item->psz_name[0] == '.' ) ||
-            ( i_name_len == 1 && p_item->psz_name[0] == '.' ) ||
-            ( i_name_len == 2 && p_item->psz_name[0] == '.' &&
-              p_item->psz_name[1] == '.' ) ||
-            has_ext( psz_ignored_exts, p_item->psz_name ))
+        /* skip null, "." and ".." and hidden files if option is activated */
+        if( !i_name_len || strcmp( p_item->psz_name, "." ) == 0
+         || strcmp( p_item->psz_name, ".." ) == 0
+         || ( !b_show_hiddenfiles && p_item->psz_name[0] == '.' ) )
+            goto skip_item;
+        /* skip ignored files */
+        if( has_ext( psz_ignored_exts, p_item->psz_name ) )
             goto skip_item;
 
         input_item_CopyOptions( p_node->p_item, p_item );
-- 
2.8.0.rc3



More information about the vlc-devel mailing list