+ else if( i_dir_content <= 0 )
+ {
+ /* directory is empty */
+ msg_Dbg( p_playlist, "%s directory is empty", psz_name );
+ free( pp_dir_content );
+ return VLC_SUCCESS;
+ }
+
+ /* Build array with ignores */
+ psz_ignore = var_CreateGetString( p_playlist, "ignore-filetypes" );
+ if( psz_ignore && *psz_ignore )
+ {
+ char *psz_parser = psz_ignore;
+ int a;
+
+ for( a = 0; psz_parser[a] != '\0'; a++ )
+ {
+ if( psz_parser[a] == ',' ) i_extensions++;
+ }
+
+ ppsz_extensions = (char **)calloc (i_extensions, sizeof (char *));
+
+ for( a = 0; a < i_extensions; a++ )
+ {
+ char *tmp, *ptr;
+
+ while( psz_parser[0] != '\0' && psz_parser[0] == ' ' ) psz_parser++;
+ ptr = strchr( psz_parser, ',');
+ tmp = ( ptr == NULL )
+ ? strdup( psz_parser )
+ : strndup( psz_parser, ptr - psz_parser );
+
+ ppsz_extensions[a] = tmp;
+ psz_parser = ptr + 1;
+ }
+ }
+ free( psz_ignore );