[vlc-commits] playlist/directory: refactor

Thomas Guillem git at videolan.org
Sat Apr 2 15:48:42 CEST 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Apr  1 10:31:03 2016 +0200| [2ff28cddde2a9ec7135af0f8352f1c9f116bb925] | committer: Rémi Denis-Courmont

playlist/directory: refactor

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

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

 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 );



More information about the vlc-commits mailing list