]> git.sesse.net Git - vlc/commitdiff
Fix input-slave parser
authorClément Stenac <zorglub@videolan.org>
Wed, 24 Nov 2004 06:52:05 +0000 (06:52 +0000)
committerClément Stenac <zorglub@videolan.org>
Wed, 24 Nov 2004 06:52:05 +0000 (06:52 +0000)
src/input/input.c

index d08d645dc9bf7e8b27e62d21d58576bf419d92da..3d2e0313bdc91c07431efc5f2212ba8ee7244b2a 100644 (file)
@@ -715,23 +715,21 @@ static int Init( input_thread_t * p_input )
     psz = var_GetString( p_input, "input-slave" );
     if( *psz )
     {
-        char *psz_delim = strchr( psz, '#' );
-
-        for( ;; )
+        char *psz_delim;
+        input_source_t *slave;
+        while( psz && *psz )
         {
-            input_source_t *slave;
-
-            if( psz_delim )
+            while( *psz == ' ' || *psz == '#' )
+            {
+                psz++;
+            }
+            if( ( psz_delim = strchr( psz, '#' ) ) )
             {
                 *psz_delim++ = '\0';
             }
-
-            if( *psz == '\0' )
+            if( *psz == 0 )
             {
-                if( psz_delim )
-                    continue;
-                else
-                    break;
+                break;
             }
 
             msg_Dbg( p_input, "adding slave '%s'", psz );
@@ -740,11 +738,10 @@ static int Init( input_thread_t * p_input )
             {
                 TAB_APPEND( p_input->i_slave, p_input->slave, slave );
             }
-            if( !psz_delim )
-                break;
+            psz = psz_delim;
         }
+        free( psz );
     }
-    free( psz );
 
     /* Set up es_out */
     es_out_Control( p_input->p_es_out, ES_OUT_SET_ACTIVE, VLC_TRUE );