- switch( *s_mrl )
- {
- case ' ':
- {
- s_mrl++;
- break;
- }
- case ':': /* an option */
- {
- s_temp = Find_end_MRL( s_mrl );
-
- if( s_temp == NULL )
- {
- i_error = 1;
- }
- else
- {
- i_options++;
- ppsz_options = realloc( ppsz_options , i_options *
- sizeof(char *) );
- ppsz_options[ i_options - 1 ] =
- malloc( (s_temp - s_mrl + 1) * sizeof(char) );
-
- strncpy( ppsz_options[ i_options - 1 ] , s_mrl ,
- s_temp - s_mrl );
-
- /* don't forget to finish the string with a '\0' */
- (ppsz_options[ i_options - 1 ])[ s_temp - s_mrl ] = '\0';
-
- s_mrl = s_temp;
- }
- break;
- }
- default:
- {
- i_error = 1;
- break;
- }
- }
- }
-
- if( i_error != 0 )
- {
- free( mrl );
- }
- else
- {
- /* now create an item */
- p_item = playlist_ItemNew( p_intf, mrl, psz_name );
- for( i = 0 ; i< i_options ; i++ )