From: Jaroslav Kysela Date: Thu, 19 Nov 2015 15:16:57 +0000 (+0100) Subject: m3u parser: another url parsing fix X-Git-Tag: v4.2.1~1509 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2fd7f73d5a10a2091d38a0fe9481f2a72869e72a;p=thirdparty%2Ftvheadend.git m3u parser: another url parsing fix --- diff --git a/src/misc/m3u.c b/src/misc/m3u.c index a824b33a0..2191e7708 100644 --- a/src/misc/m3u.c +++ b/src/misc/m3u.c @@ -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); +} + /* * */ @@ -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] == '/') {