[vlc-commits] Revert "playlist: m3u: use cctype"

Francois Cartegnie git at videolan.org
Thu Mar 12 19:42:45 CET 2020


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Mar 12 19:41:19 2020 +0100| [d2e153423f739eed09c28781eba465f41fd2b087] | committer: Francois Cartegnie

Revert "playlist: m3u: use cctype"

This reverts commit 984fa85411f3129ea7f9fd71168401f3e4a92e12.

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

 modules/demux/playlist/m3u.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/modules/demux/playlist/m3u.c b/modules/demux/playlist/m3u.c
index 5780f94d97..854f885e22 100644
--- a/modules/demux/playlist/m3u.c
+++ b/modules/demux/playlist/m3u.c
@@ -36,8 +36,6 @@
 
 #include "playlist.h"
 
-#include <ctype.h>
-
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
@@ -290,16 +288,17 @@ static int ReadDir( stream_t *p_demux, input_item_node_t *p_subitems )
         char *psz_parse = psz_line;
 
         /* Skip leading tabs and spaces */
-        while( isspace( *psz_parse ) )
-            psz_parse++;
+        while( *psz_parse == ' ' || *psz_parse == '\t' ||
+               *psz_parse == '\n' || *psz_parse == '\r' ) psz_parse++;
 
         if( *psz_parse == '#' )
         {
             /* Parse extra info */
 
             /* Skip leading tabs and spaces */
-            while( isspace( *psz_parse ) || *psz_parse == '#' )
-                psz_parse++;
+            while( *psz_parse == ' ' || *psz_parse == '\t' ||
+                   *psz_parse == '\n' || *psz_parse == '\r' ||
+                   *psz_parse == '#' ) psz_parse++;
 
             if( !*psz_parse ) goto nextline;
 
@@ -464,7 +463,7 @@ static void parseEXTINFIptvDiotsInDuration( char *psz_string,
 {
     for( ;; )
     {
-        while( isspace( *psz_string ) )
+        while( *psz_string == '\t' || *psz_string == ' ' )
             psz_string++;
 
         char *psz_start = psz_string;
@@ -520,7 +519,7 @@ static void parseEXTINF( char *psz_string,
     FREENULL( meta->psz_artist );
 
     /* strip leading whitespaces */
-    while( psz_string < end && isspace( *psz_string ) )
+    while( psz_string < end && ( *psz_string == '\t' || *psz_string == ' ' ) )
         psz_string++;
 
     /* duration: read to next comma */
@@ -538,7 +537,7 @@ static void parseEXTINF( char *psz_string,
     if( i_parsed_duration > 0 )
         meta->i_duration = vlc_tick_from_sec( i_parsed_duration );
 
-    if( psz_end && psz_end != psz_string && isspace(*psz_end) )
+    if( psz_end && psz_end != psz_string && ( *psz_end == '\t' || *psz_end == ' ' ) )
     {
         parseEXTINFIptvDiotsInDuration( psz_end, pf_dup, meta );
     }



More information about the vlc-commits mailing list