]> git.sesse.net Git - vlc/commitdiff
Skip leading tabs, spaces and line feeds
authorClément Stenac <zorglub@videolan.org>
Tue, 18 May 2004 20:41:19 +0000 (20:41 +0000)
committerClément Stenac <zorglub@videolan.org>
Tue, 18 May 2004 20:41:19 +0000 (20:41 +0000)
modules/demux/playlist/m3u.c
src/input/stream.c

index adac98daf8cd3d395e60268655b0b5f49f4e3be1..cb576a7f10a58fdff1618222638d7307b028afbe 100644 (file)
@@ -134,6 +134,14 @@ static int Demux( demux_t *p_demux )
     i_position = p_playlist->i_index + 1;
     while( ( psz_line = stream_ReadLine( p_demux->s ) ) )
     {
+
+        /* Skip leading tabs and spaces */
+        while( *psz_line == ' ' || *psz_line == '\t' ||
+               *psz_line == '\n' || *psz_line == '\r' )
+        {
+            psz_line++;
+        }
+
         if( *psz_line == '#' )
         {
             /* parse extra info */
index 32f230834c4d3dc958abe835130c4bd079d04ef8..e6c26b2497c77719fe7c2d86f3e3dcac76a675d4 100644 (file)
@@ -45,7 +45,7 @@ char *stream_ReadLine( stream_t *s )
     int      i = 0;
     i_data = stream_Peek( s, &p_data, MAX_LINE );
 
-    while( i < i_data && p_data[i] != '\n' &&  i < i_data && p_data[i] != '\r')
+    while( i < i_data && p_data[i] != '\n' &&  p_data[i] != '\r' )
     {
         i++;
     }