Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
m3u parser: another url parsing fix
  • Loading branch information
perexg committed Nov 19, 2015
1 parent 9c23b92 commit 2fd7f73
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions src/misc/m3u.c
Expand Up @@ -68,6 +68,22 @@ static char *until_eol(char *d)
return d;
}

/*
*
*/
static int is_full_url(const char *url)
{
return
strncmp(url, "file://", 7) == 0 ||
strncmp(url, "pipe://", 7) == 0 ||
strncmp(url, "http://", 7) == 0 ||
strncmp(url, "https://", 8) == 0 ||
strncmp(url, "rtsp://", 7) == 0 ||
strncmp(url, "rtsps://", 8) == 0 ||
strncmp(url, "udp://", 6) == 0 ||
strncmp(url, "rtp://", 6);
}

/*
*
*/
Expand All @@ -78,14 +94,7 @@ static const char *get_url

if (url == NULL)
return rel;
if (strncmp(url, "file://", 7) &&
strncmp(url, "pipe://", 7) &&
strncmp(url, "http://", 7) &&
strncmp(url, "https://", 8) &&
strncmp(url, "rtsp://", 7) &&
strncmp(url, "rtsps://", 8) &&
strncmp(url, "udp://", 6) &&
strncmp(url, "rtp://", 6))
if (!is_full_url(url) || is_full_url(rel))
return rel;

if (rel[0] == '/') {
Expand Down

0 comments on commit 2fd7f73

Please sign in to comment.